-
Notifications
You must be signed in to change notification settings - Fork 506
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
Getting 400 Bad request when using the swagger-ui. #15
Comments
It's also flask-restful bug that has been fixed upstream but not yet released: flask-restful/flask-restful#366 |
In the beginning I thought that putting Content-Type for GET request is violation of HTTP/1.1, so for me, it was definitely client's problem. Based on this discussion, I understand that there is no explicit rule in the HTTP/1.1 specification that forbids this rule. So, it was at flask-restful the right place to fix it, but it is also good that the swagger-ui client reduced this abuse of 'content-type' header with their new release. Thanks, everyday learning :) Hope to see these changes released soon, it is a PITA bug for development :P |
Yeah, that's what's interesting in programming: you learn every day !! :) I'm waiting too for flask-restplus release because me too I've been spending a lot of time trying to figure out what's happening !! :) pip install http://github.com/flask-restful/flask-restful/tarball/231da4b |
It should have been fixed in Flask-restful 0.3.2. |
Using swagger-ui I always get
400 Bad request
if there is at least one argument for parsing. For endpoints that have no parameters it works just fine. Notice that the API works with no problem if I consume it from any other client, even the same browser by just requesting the URL in a different window.After investigation I found that it was a problem of swagger-ui client that it always puts the 'Content-type: application/json` even for GET requests. Werkzeug or Flask(not sure) finds illegal putting content-type header without having any HTTP payload (the case of GET), thus the 400 Bad request.
The text was updated successfully, but these errors were encountered: