Flask - How do I read the raw body in a POST request when the content type is “application/x-www-form-urlencoded”

前端 未结 4 802
既然无缘
既然无缘 2020-12-31 06:23

Turns out that Flask sets request.data to an empty string if the content type of the request is application/x-www-form-urlencoded. Since I\'m using

4条回答
  •  离开以前
    2020-12-31 07:15

    You can get the post data via request.form.keys()[0] if content type is application/x-www-form-urlencoded.

    request.form is a multidict, whose keys contain the parsed post data.

提交回复
热议问题