`
cooler1217
  • 浏览: 367839 次
  • 性别: Icon_minigender_1
  • 来自: 长春
社区版块
存档分类
最新评论

flask 获取http 头 和 各种表单数据,json

 
阅读更多
http://stackoverflow.com/questions/10434599/how-can-i-get-the-whole-request-post-body-in-python-with-flask



g.HEADERS =  request.headers

    logger.info("data:"+str(request.data))

    logger.info("json:"+str(request.json))

    logger.info("values:"+str(request.values))

    g.args = request.args if request.method == 'GET' else request.form

    logger.debug(g.HEADERS.get("Device_id",'nodeviceid')+"\t"+request.path+"\t"+str(g.args))
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics