FastAPI · Function
Cookie
FastAPI can read request cookies with Cookie(). Declare the cookie as a typed parameter, and use a default such as None when it is optional.
Last updated
Syntax
parameter: Annotated[type, Cookie()] = defaultIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
QueryPathResponsePydantic BaseModelCookie parameter models