Skip to content

Instantly share code, notes, and snippets.

@sivabudh
Created April 8, 2016 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sivabudh/ee6bd24ec66dcd88181606f230f98d94 to your computer and use it in GitHub Desktop.
Save sivabudh/ee6bd24ec66dcd88181606f230f98d94 to your computer and use it in GitHub Desktop.
from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class HelloWorld(Resource):
def get(self):
return {'hello': 'world'}
def post(self):
import pdb; pdb.set_trace()
json = request.get_json()
return {'hello': 'blah'}
api.add_resource(HelloWorld, '/')
if __name__ == '__main__':
app.run(debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment