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

前端 未结 4 823
既然无缘
既然无缘 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:12

    Use request.get_data() to get the POST data. This works independent of whether the data has content type application/x-www-form-urlencoded or application/octet-stream.

提交回复
热议问题