flask出错。
搜:
flask “message”: “The browser (or proxy) sent a request that this server could not understand.”
This error message: “The browser (or proxy) sent a request that this server could not understand” happens if you speak https to a http server or http to a https server. Check your configuration of the websever. I guess you a running http on port 443.
on_json_loading_failed(e)Called if decoding of the JSON data failed. The return value of this method is used by json when an error ocurred. The default implementation raises a JSONBadRequest, which is a subclass of BadRequest which sets the Content-Type to application/json and provides a JSON-formatted error description:{“description”: “The browser (or proxy) sent a request that this server could not understand.”}Changed in version 0.9: Return a JSONBadRequest instead of a BadRequest by default.New in version 0.8.
class BadRequest(HTTPException):“””*400* `Bad Request`Raise if the browser sends something to the application the applicationor server cannot handle.“””code = 400description = (‘The browser (or proxy) sent a request that this server could ‘‘not understand.’)
->
最后证明:
是此处的Json数据有问题:
之前为了测试,把key的字符串从双引号改为单引号了
-》改回正常的双引号,即可。
转载请注明:在路上 » [已解决]访问flask的Web服务器出错:message The browser or proxy sent a request that this server could not understand