-
Notifications
You must be signed in to change notification settings - Fork 51
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
Application/json requests to Potion routes fails #94
Comments
At first look, this would make sense. If you send a GET request you will send an empty request body, but "" (empty message) is not valid JSON. We could silently ignore JSON in GET requests. What solution do you propose? |
(To clarify: sending an empty message with Content-Type: application/json is indeed an invalid request) |
I wouldn't silently ignore. Maybe a more meaningful message then |
Remove the old one Request in POSTMAN Collection and create new one. |
I'm running into the same issue when I try to make a put request using Postman with Context-Type application/json. All other endpoints which use the same route and same header work (get, post, delete) however put does not work. I initially removed the old request and made a new one. That fixed it the first time. However, that only worked once. Now I'm running into this same error indefinitely.
|
GUYS OK I THINK I FIGURED IT OUT You need to also have the Content-Length header enabled. Otherwise you'll get this error. |
I have a user resource registered with potion:
If I query
/api/user
with eitherContent-Type: application/json
orapplication/text
I get a list of users as expected.If I query
/api/user/me
withContent-Type: application/text
I get back1
as expected.If I query it with
Content-Type: application/json
I get:I use Postman to tests the requests. I stripped out all decorators for authentication for the sake of this test. I've tried with Flask 0.10 and Flask 0.11 (the above mentioned error is with Flask 0.11). With 0.10 I had the same issue with a less verbose message. Python 3.4
The text was updated successfully, but these errors were encountered: