Skip to content

Instantly share code, notes, and snippets.

@matdziu
Created October 27, 2016 13:00
Show Gist options
  • Select an option

  • Save matdziu/70d377b1c11d7886cbca3313b61fa2f2 to your computer and use it in GitHub Desktop.

Select an option

Save matdziu/70d377b1c11d7886cbca3313b61fa2f2 to your computer and use it in GitHub Desktop.
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