Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Should use request.get_json(silent=True) #3

Open
lanecm opened this issue Sep 24, 2014 · 2 comments
Open

Should use request.get_json(silent=True) #3

lanecm opened this issue Sep 24, 2014 · 2 comments

Comments

@lanecm
Copy link

lanecm commented Sep 24, 2014

On line 59, I think it would be better to use:

request.get_json(silent=True)

instead of:

request.json

Then you won't get those The browser (or proxy) sent a request that this server could not understand errors.

@adamtheturtle
Copy link

.json is now deprecated and raises a warning. See http://flask.pocoo.org/docs/0.11/changelog/:

Deprecated request.json in favour of request.get_json().

@kingname
Copy link

I find that if I use

request.get_json(silent=True)

I will get None, but if I use

request.get_json()

I will get the right data.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants