flask return json data

K = {

  'a':1

}

return jsonify(ret)

Not directly return ret, should jsonify (). Such return Content-Type: application / json; charset = utf-8

 

If you use json.dumps (ret) return Content-Type: text / html

Guess you like

Origin www.cnblogs.com/shining5/p/12124781.html