Skip to content

How to require request headers or fail (migration from FastAPI) #2286

Closed Answered by Alc-Alc
danielniccoli asked this question in Q&A
Discussion options

You must be logged in to vote

Does this do what you want?

from litestar.params import Parameter

x_ms_client_principal_id: Annotated[str, Parameter(header="x_ms_client_principal_id")]
x_ms_client_principal_name: Annotated[str, Parameter(header="x_ms_client_principal_name")]

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@danielniccoli
Comment options

Answer selected by danielniccoli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants