-
Notifications
You must be signed in to change notification settings - Fork 303
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
405 Method Not Allowed is returning a HTML response instead of JSON #362
Comments
Probably won't be able to change this within flask-restless. A workaround would be to allow the method via the api manager and use a preprocessor to return the json error response. |
I have submitted pull request #366 that has fixed this issue. All http exceptions are now returned in JSON format without requiring manual implementation with preprocessors. |
I may have a problem with that pull request, see the comment I am about to post there. |
I have closed the pull request suggested by @jkehler, but I'm happy to review another one that makes the changes I suggested in the discussion there. |
This should be fixable if we require Flask 1.0, since pallets/flask#503 has been fixed, i.e. we can use blueprint-local error-handling to create an error-handler for HTTP 405 responses that responds with a JSON API document. |
The versioning for Flask became weird; pallets/flask#503 seems to have been included in Flask 0.11. |
Wouldn't best practices be that all responses be returned in JSON format? Is there any way to override this behavior?
I think it should be returning something like this instead.
The text was updated successfully, but these errors were encountered: