Skip to content

Return MethodNotAllowed for request with wrong HTTP method #111

@dbrgn

Description

@dbrgn

It would be great if router would return a "HTTP 405 Method Not Allowed" for routes where a route exists, but a non-matching request method was used.

Example:

router.get("/things", thing_list_handler);
router.post("/things", thing_create_handler);

Here a PUT request to /things should result in a HTTP 405.

I realize that this could be implemented with an any route for all paths, but turning this on globally would make things much simpler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions