Return JSON response from Flask view
- flask
- json
jsonify
dumps the given data to JSON like json.dumps
, creates a response object, and sets the content type to application/json
. It used to only accept dicts or keyword arguments, due to a security issue in IE6. As of 0.11 it accepts any JSON-serializable object. Passing args is the same as passing a list. Passing kwargs is the same as passing a dict.