标签: python json post request
嗨,我正在尝试用Python检索POST数据(在json中),我可以在GET请求中完成它,就像这样:
@app.route("/getmsg", methods=['GET']) def getmsg(): user = request.args.get('user')
但是当我在Json的POST请求上使用request.forms.get('user')时(例如{'user':'abcd'}),它说请求失败
有人可以告诉我如何正确地获取json数据吗?非常感谢。