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
request.data
application/x-www-form-urlencoded
You can get the post data via request.form.keys()[0] if content type is application/x-www-form-urlencoded.
request.form.keys()[0]
request.form is a multidict, whose keys contain the parsed post data.
request.form