Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 68 for Cookie2 (0.35 sec)

  1. docs/de/docs/advanced/response-change-status-code.md

    In diesen Fällen können Sie einen `Response`-Parameter verwenden.
    
    ## Einen `Response`-Parameter verwenden
    
    Sie können einen Parameter vom Typ `Response` in Ihrer *Pfadoperation-Funktion* deklarieren (wie Sie es auch für Cookies und Header tun können).
    
    Anschließend können Sie den `status_code` in diesem *vorübergehenden* Response-Objekt festlegen.
    
    ```Python hl_lines="1  9  12"
    {!../../../docs_src/response_change_status_code/tutorial001.py!}
    ```
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 30 20:18:58 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  2. docs_src/dependencies/tutorial005_an.py

    from typing import Union
    
    from fastapi import Cookie, Depends, FastAPI
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    def query_extractor(q: Union[str, None] = None):
        return q
    
    
    def query_or_cookie_extractor(
        q: Annotated[str, Depends(query_extractor)],
        last_query: Annotated[Union[str, None], Cookie()] = None,
    ):
        if not q:
            return last_query
        return q
    
    
    @app.get("/items/")
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 558 bytes
    - Viewed (0)
  3. docs/es/docs/advanced/response-change-status-code.md

    Para esos casos, puedes usar un parámetro `Response`.
    
    ## Usar un parámetro `Response`
    
    Puedes declarar un parámetro de tipo `Response` en tu *función de la operación de path* (como puedes hacer para cookies y headers).
    
    Y luego puedes establecer el `status_code` en ese objeto de respuesta *temporal*.
    
    ```Python hl_lines="1  9  12"
    {!../../../docs_src/response_change_status_code/tutorial001.py!}
    ```
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Feb 06 19:56:23 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  4. fastapi/__init__.py

    from .exceptions import HTTPException as HTTPException
    from .exceptions import WebSocketException as WebSocketException
    from .param_functions import Body as Body
    from .param_functions import Cookie as Cookie
    from .param_functions import Depends as Depends
    from .param_functions import File as File
    from .param_functions import Form as Form
    from .param_functions import Header as Header
    from .param_functions import Path as Path
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu May 02 22:50:18 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  5. doc/next/6-stdlib/99-minor/net/http/61472.md

    The new [Request.CookiesNamed] method retrieves all cookies that match the given name....
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 20 18:08:20 UTC 2024
    - 87 bytes
    - Viewed (0)
  6. docs/de/docs/tutorial/header-params.md

    # Header-Parameter
    
    So wie `Query`-, `Path`-, und `Cookie`-Parameter können Sie auch <abbr title='Header – Kopfzeilen, Header, Header-Felder: Schlüssel-Wert-Metadaten, die vom Client beim Request, und vom Server bei der Response gesendet werden'>Header</abbr>-Parameter definieren.
    
    ## `Header` importieren
    
    Importieren Sie zuerst `Header`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="3"
        {!> ../../../docs_src/header_params/tutorial001_an_py310.py!}
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 30 18:00:50 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  7. docs/zh/docs/tutorial/header-params.md

        ```
    
    !!! note "技术细节"
    
        `Header` 是 `Path`、`Query`、`Cookie` 的**兄弟类**,都继承自共用的 `Param` 类。
    
        注意,从 `fastapi` 导入的 `Query`、`Path`、`Header` 等对象,实际上是返回特殊类的函数。
    
    !!! info "说明"
    
        必须使用 `Header` 声明 header 参数,否则该参数会被解释为查询参数。
    
    ## 自动转换
    
    `Header` 比 `Path`、`Query` 和 `Cookie` 提供了更多功能。
    
    大部分标准请求头用**连字符**分隔,即**减号**(`-`)。
    
    但是 `user-agent` 这样的变量在 Python 中是无效的。
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 30 22:42:51 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  8. docs_src/dependencies/tutorial005_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import Cookie, Depends, FastAPI
    
    app = FastAPI()
    
    
    def query_extractor(q: Union[str, None] = None):
        return q
    
    
    def query_or_cookie_extractor(
        q: Annotated[str, Depends(query_extractor)],
        last_query: Annotated[Union[str, None], Cookie()] = None,
    ):
        if not q:
            return last_query
        return q
    
    
    @app.get("/items/")
    async def read_query(
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 529 bytes
    - Viewed (0)
  9. docs/en/mkdocs.yml

        - advanced/additional-status-codes.md
        - advanced/response-directly.md
        - advanced/custom-response.md
        - advanced/additional-responses.md
        - advanced/response-cookies.md
        - advanced/response-headers.md
        - advanced/response-change-status-code.md
        - advanced/advanced-dependencies.md
        - Advanced Security:
          - advanced/security/index.md
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu May 02 22:37:31 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  10. docs/zh/docs/features.md

    * HTTP 基本认证。
    * **OAuth2** (也使用 **JWT tokens**)。在 [OAuth2 with JWT](tutorial/security/oauth2-jwt.md){.internal-link target=_blank}查看教程。
    * API 密钥,在:
        * 请求头。
        * 查询参数。
        * Cookies, 等等。
    
    加上来自 Starlette(包括 **session cookie**)的所有安全特性。
    
    所有的这些都是可复用的工具和组件,可以轻松与你的系统,数据仓库,关系型以及 NoSQL 数据库等等集成。
    
    
    
    ### 依赖注入
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 9K bytes
    - Viewed (0)
Back to top