0

I can't figure this one out, it's not in the request.JSON and the request.data is coming up as empty bytes in the debug. There appears to be a post but the data is disappearing? Is this a bug with Flask?

Here's a link to their documentation page that has a Django example: https://documentation.mailgun.com/en/latest/quickstart-receiving.html#supported-actions-for-routes

L Martin
  • 1,180
  • 8
  • 18

1 Answers1

0

Figured this out: Clue was in the header

'Content-Type': 'application/x-www-form-urlencoded'

Flask automatically strips out form data into request.form leaving request.data and request.json empty:

@app.route("/test-mail/", methods=["POST"], strict_slashes=False)
def test_mail():
    print(request.form)
    return 'OK'
L Martin
  • 1,180
  • 8
  • 18