Skip to content

Enhancement: Support the QUERY HTTP method #4626

@marcuslimdw

Description

@marcuslimdw

Summary

Add QUERY to HttpMethod and create a dedicated query route handler decorator that, like the others, delegates to HTTPRouteHandler. In CSRFConfig and other places (not 100% sure where), also add QUERY as a safe method.

Basic Example

@HTTPRouteHandler("/", http_method="QUERY")
def query() -> None:
    pass

becomes:

@query("/")  # type: ignore
def query() -> None:
    pass

Drawbacks and Impact

I'm not familiar enough with Litestar's routing to be able to say what the performance impact would be.

Unresolved questions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementThis is a new feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions