Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 181 for cookie (0.32 sec)

  1. docs/em/docs/tutorial/header-params.md

    🥇 💲 🔢 💲, 👆 💪 🚶‍♀️ 🌐 ➕ 🔬 ⚖️ ✍ 🔢:
    
    === "🐍 3️⃣.6️⃣ & 🔛"
    
        ```Python hl_lines="9"
        {!> ../../../docs_src/header_params/tutorial001.py!}
        ```
    
    === "🐍 3️⃣.1️⃣0️⃣ & 🔛"
    
        ```Python hl_lines="7"
        {!> ../../../docs_src/header_params/tutorial001_py310.py!}
        ```
    
    !!! note "📡 ℹ"
        `Header` "👭" 🎓 `Path`, `Query` & `Cookie`. ⚫️ 😖 ⚪️➡️ 🎏 ⚠ `Param` 🎓.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  2. docs_src/response_cookies/tutorial002.py

    from fastapi import FastAPI, Response
    
    app = FastAPI()
    
    
    @app.post("/cookie-and-object/")
    def create_cookie(response: Response):
        response.set_cookie(key="fakesession", value="fake-cookie-session-value")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 272 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_cookie_params/test_tutorial001.py

                200,
                {"ads_id": "ads_track"},
            ),
            ("/items", {"session": "cookiesession"}, 200, {"ads_id": None}),
        ],
    )
    def test(path, cookies, expected_status, expected_response):
        client = TestClient(app, cookies=cookies)
        response = client.get(path)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    def test_openapi_schema():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  4. tests/test_param_include_in_schema.py

    from typing import Optional
    
    import pytest
    from fastapi import Cookie, FastAPI, Header, Path, Query
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.get("/hidden_cookie")
    async def hidden_cookie(
        hidden_cookie: Optional[str] = Cookie(default=None, include_in_schema=False),
    ):
        return {"hidden_cookie": hidden_cookie}
    
    
    @app.get("/hidden_header")
    async def hidden_header(
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 16:56:53 GMT 2024
    - 7.4K bytes
    - Viewed (0)
  5. docs/ja/docs/tutorial/header-params.md

    # ヘッダーのパラメータ
    
    ヘッダーのパラメータは、`Query`や`Path`、`Cookie`のパラメータを定義するのと同じように定義できます。
    
    ## `Header`をインポート
    
    まず、`Header`をインポートします:
    
    ```Python hl_lines="3"
    {!../../../docs_src/header_params/tutorial001.py!}
    ```
    
    ## `Header`のパラメータの宣言
    
    次に、`Path`や`Query`、`Cookie`と同じ構造を用いてヘッダーのパラメータを宣言します。
    
    最初の値がデフォルト値で、追加の検証パラメータや注釈パラメータをすべて渡すことができます。
    
    ```Python hl_lines="9"
    {!../../../docs_src/header_params/tutorial001.py!}
    ```
    
    !!! note "技術詳細"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Oct 17 13:55:39 GMT 2020
    - 3.8K bytes
    - Viewed (0)
  6. docs/en/docs/reference/responses.md

                - set_cookie
                - delete_cookie
    
    ::: fastapi.responses.Response
        options:
            members:
                - charset
                - status_code
                - media_type
                - body
                - background
                - raw_headers
                - render
                - init_headers
                - headers
                - set_cookie
                - delete_cookie
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_websockets/test_tutorial002_an_py310.py

    
    @needs_py310
    def test_websocket_with_cookie(app: FastAPI):
        client = TestClient(app, cookies={"session": "fakesession"})
        with pytest.raises(WebSocketDisconnect):
            with client.websocket_connect("/items/foo/ws") as websocket:
                message = "Message one"
                websocket.send_text(message)
                data = websocket.receive_text()
                assert data == "Session cookie or query token value is: fakesession"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  8. docs/ru/docs/tutorial/schema-extra-example.md

    ## Использование `example` и `examples` в OpenAPI
    
    При использовании любой из этих функций:
    
    * `Path()`
    * `Query()`
    * `Header()`
    * `Cookie()`
    * `Body()`
    * `Form()`
    * `File()`
    
    вы также можете добавить аргумент, содержащий `example` или группу `examples` с дополнительной информацией, которая будет добавлена в **OpenAPI**.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  9. docs/zh/docs/tutorial/request-forms.md

    ```
    
    例如,OAuth2 规范的 "密码流" 模式规定要通过表单字段发送 `username` 和 `password`。
    
    <abbr title="specification">该规范</abbr>要求字段必须命名为 `username` 和 `password`,并通过表单字段发送,不能用 JSON。
    
    使用 `Form` 可以声明与 `Body` (及 `Query`、`Path`、`Cookie`)相同的元数据和验证。
    
    !!! info "说明"
    
        `Form` 是直接继承自 `Body` 的类。
    
    !!! tip "提示"
    
        声明表单体要显式使用 `Form` ,否则,FastAPI 会把该参数当作查询参数或请求体(JSON)参数。
    
    ## 关于 "表单字段"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:02:19 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  10. docs_src/dependencies/tutorial005.py

    from typing import 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: str = Depends(query_extractor),
        last_query: Union[str, None] = Cookie(default=None),
    ):
        if not q:
            return last_query
        return q
    
    
    @app.get("/items/")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 486 bytes
    - Viewed (0)
Back to top