Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 62 for cookies (0.07 sec)

  1. docs/en/docs/advanced/response-cookies.md

    # Response Cookies { #response-cookies }
    
    ## Use a `Response` parameter { #use-a-response-parameter }
    
    You can declare a parameter of type `Response` in your *path operation function*.
    
    And then you can set cookies in that *temporal* response object.
    
    {* ../../docs_src/response_cookies/tutorial002.py hl[1, 8:9] *}
    
    And then you can return any object you need, as you normally would (a `dict`, a database model, etc).
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 2.2K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/cookie-param-models.md

    You can use Pydantic's model configuration to `forbid` any `extra` fields:
    
    {* ../../docs_src/cookie_param_models/tutorial002_an_py39.py hl[10] *}
    
    If a client tries to send some **extra cookies**, they will receive an **error** response.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 3.1K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/cookie-params.md

    # Cookie Parameters { #cookie-parameters }
    
    You can define Cookie parameters the same way you define `Query` and `Path` parameters.
    
    ## Import `Cookie` { #import-cookie }
    
    First import `Cookie`:
    
    {* ../../docs_src/cookie_params/tutorial001_an_py310.py hl[3] *}
    
    ## Declare `Cookie` parameters { #declare-cookie-parameters }
    
    Then declare the cookie parameters using the same structure as with `Path` and `Query`.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 1.1K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/response-change-status-code.md

    For those cases, you can use a `Response` parameter.
    
    ## Use a `Response` parameter { #use-a-response-parameter }
    
    You can declare a parameter of type `Response` in your *path operation function* (as you can do for cookies and headers).
    
    And then you can set the `status_code` in that *temporal* response object.
    
    {* ../../docs_src/response_change_status_code/tutorial001.py hl[1,9,12] *}
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 1.5K bytes
    - Viewed (0)
  5. docs/en/docs/advanced/response-headers.md

    **FastAPI** will use that *temporal* response to extract the headers (also cookies and status code), and will put them in the final response that contains the value you returned, filtered by any `response_model`.
    
    You can also declare the `Response` parameter in dependencies, and set headers (and cookies) in them.
    
    ## Return a `Response` directly { #return-a-response-directly }
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 2.3K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/cors.md

    ## Wildcards { #wildcards }
    
    It's also possible to declare the list as `"*"` (a "wildcard") to say that all are allowed.
    
    But that will only allow certain types of communication, excluding everything that involves credentials: Cookies, Authorization headers like those used with Bearer Tokens, etc.
    
    So, for everything to work correctly, it's better to specify explicitly the allowed origins.
    
    ## Use `CORSMiddleware` { #use-corsmiddleware }
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 5.5K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/query-param-models.md

            }
        ]
    }
    ```
    
    ## Summary { #summary }
    
    You can use **Pydantic models** to declare **query parameters** in **FastAPI**. 😎
    
    /// tip
    
    Spoiler alert: you can also use Pydantic models to declare cookies and headers, but you will read about that later in the tutorial. 🀫
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 2.2K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/testing.md

    * If you need to send *Form Data* instead of JSON, use the `data` parameter instead.
    * To pass *headers*, use a `dict` in the `headers` parameter.
    * For *cookies*, a `dict` in the `cookies` parameter.
    
    For more information about how to pass data to the backend (using `httpx` or the `TestClient`) check the <a href="https://www.python-httpx.org" class="external-link" target="_blank">HTTPX documentation</a>.
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 6.6K bytes
    - Viewed (0)
  9. docs/uk/docs/index.md

    * <abbr title="Ρ‚Π°ΠΊΠΎΠΆ Π²Ρ–Π΄ΠΎΠΌΠΈΠΉ як: serialization, parsing, marshalling">ΠŸΠ΅Ρ€Π΅Ρ‚Π²ΠΎΡ€Π΅Π½Π½Ρ</abbr> Π²Ρ…Ρ–Π΄Π½ΠΈΡ… Π΄Π°Π½ΠΈΡ…: Π· ΠΌΠ΅Ρ€Π΅ΠΆΡ– Π΄ΠΎ Π΄Π°Π½ΠΈΡ… Ρ– Ρ‚ΠΈΠΏΡ–Π² Python. Читання Π·:
        * JSON.
        * ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ–Π² ΡˆΠ»ΡΡ…Ρƒ.
        * ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ–Π² Π·Π°ΠΏΠΈΡ‚Ρƒ.
        * Cookies.
        * Headers.
        * Forms.
        * Π€Π°ΠΉΠ»Ρ–Π².
    * <abbr title="Ρ‚Π°ΠΊΠΎΠΆ Π²Ρ–Π΄ΠΎΠΌΠΈΠΉ як: serialization, parsing, marshalling">ΠŸΠ΅Ρ€Π΅Ρ‚Π²ΠΎΡ€Π΅Π½Π½Ρ</abbr> Π²ΠΈΡ…Ρ–Π΄Π½ΠΈΡ… Π΄Π°Π½ΠΈΡ…: Π· Ρ‚ΠΈΠΏΡ–Π² Ρ– Π΄Π°Π½ΠΈΡ… Python Π΄ΠΎ ΠΌΠ΅Ρ€Π΅ΠΆΠ΅Π²ΠΈΡ… Π΄Π°Π½ΠΈΡ… (як JSON):
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 10:49:48 UTC 2025
    - 24.2K bytes
    - Viewed (0)
  10. docs/en/docs/advanced/using-request-directly.md

    # Using the Request Directly { #using-the-request-directly }
    
    Up to now, you have been declaring the parts of the request that you need with their types.
    
    Taking data from:
    
    * The path as parameters.
    * Headers.
    * Cookies.
    * etc.
    
    And by doing so, **FastAPI** is validating that data, converting it and generating documentation for your API automatically.
    
    But there are situations where you might need to access the `Request` object directly.
    
    Registered: Sun Sep 07 07:19:17 UTC 2025
    - Last Modified: Sun Aug 31 09:15:41 UTC 2025
    - 2.4K bytes
    - Viewed (0)
Back to top