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
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.
request.get_data()
application/octet-stream