Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Content-type: application/json; charset=utf-8" causes a 415 Unsupported Media Type #306

Closed
budowski opened this issue Apr 25, 2017 · 2 comments
Labels

Comments

@budowski
Copy link

budowski commented Apr 25, 2017

Basically the default supported content_type should also support the charset=utf-8 option (it currently doesn't, so if a client sends a Content-type: application/json; charset=utf-8 header, the API responds with a 415 Unsupported Media Type). This is important IMHO, since some clients (like Android's OkHttp add the charset=utf-8 by default).

So currently the workaround is this:

@app.route('/myRoute', methods=['POST'], content_types=['application/json; charset=utf-8', 'application/json'])
def myRoute():
      pass
@jamesls
Copy link
Member

jamesls commented Apr 27, 2017

Thanks for reporting. Confirmed bug.

@jamesls jamesls added the bug label Apr 27, 2017
alasdairnicol added a commit to alasdairnicol/python-lambda-contact-form that referenced this issue Apr 29, 2017
@jamesls
Copy link
Member

jamesls commented May 1, 2017

Fixed via #312

@jamesls jamesls closed this as completed May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants