Created
October 27, 2016 13:00
-
-
Save matdziu/70d377b1c11d7886cbca3313b61fa2f2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| from flask import Flask, Response | |
| app = Flask(__name__) | |
| data = { | |
| 'id': 7, | |
| 'name': 'James', | |
| 'surname': 'Bond', | |
| 'sex': 'male', | |
| 'status': 'M.I.A.' | |
| } | |
| @app.route('/data') | |
| def returnData(): | |
| resp = Response(response = json.dumps(data), mimetype = "application/json") | |
| return resp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment