Saturday, 15 August 2015

python - How to turn Flask Response Object into Dictionary -



python - How to turn Flask Response Object into Dictionary -

i understand flask.jsonify returns flask response object. can't figure out how convert object dictionary. how go doing this?

@app.route('/', methods=['get']) def hello(): #accept , jsonify request nexmo if request.method == 'get': info = jsonify(request.args.lists()) #turn info dictionary here process(info) homecoming info else: homecoming 'hello world!'

requests.args dictionary-like object, multidict. not need utilize jsonify on first.

you should phone call process request.args directly.

if want dict, can phone call request.args.to_dict(flat=false).

python json dictionary flask

No comments:

Post a Comment