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

Document/example for custom 404 and 405 #888

Closed
txomon opened this issue May 27, 2016 · 1 comment · Fixed by #909
Closed

Document/example for custom 404 and 405 #888

txomon opened this issue May 27, 2016 · 1 comment · Fixed by #909

Comments

@txomon
Copy link

txomon commented May 27, 2016

Long story short

When using aiohttp to create RESTfull JSON interfaces, one needs to always return JSON, but currently there is no mention on how to do it. #598 refers to this.

Expected behaviour

I would expect to be able to set app.default_not_found and app.default_not_allowed or something easy to override default responses.

Actual behaviour

I need to create a middleware (maybe simple).

Steps to reproduce

Just create an app without routes and request a path.

@asvetlov asvetlov added the sprint label Jun 2, 2016
djmitche added a commit to djmitche/aiohttp that referenced this issue Jun 3, 2016
This serves both as an example of middleware, and as a useful hint as to
how to produce custom error pages (a common request).  Fixes aio-libs#888.
asvetlov pushed a commit that referenced this issue Jun 3, 2016
This serves both as an example of middleware, and as a useful hint as to
how to produce custom error pages (a common request).  Fixes #888.
@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants