Skip to content

Document/example for custom 404 and 405 #888

@txomon

Description

@txomon

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions