Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 290 for Cookies (0.11 sec)

  1. tests/test_tutorial/test_cookie_params/test_tutorial001_an.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():
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_cookie_params/test_tutorial001_py310.py

                {"ads_id": "ads_track"},
            ),
            ("/items", {"session": "cookiesession"}, 200, {"ads_id": None}),
        ],
    )
    def test(path, cookies, expected_status, expected_response):
        from docs_src.cookie_params.tutorial001_py310 import app
    
        client = TestClient(app, cookies=cookies)
        response = client.get(path)
        assert response.status_code == expected_status
        assert response.json() == expected_response
    
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  3. src/net/http/client.go

    	var (
    		ireqhdr  = cloneOrMakeHeader(ireq.Header)
    		icookies map[string][]*Cookie
    	)
    	if c.Jar != nil && ireq.Header.Get("Cookie") != "" {
    		icookies = make(map[string][]*Cookie)
    		for _, c := range ireq.Cookies() {
    			icookies[c.Name] = append(icookies[c.Name], c)
    		}
    	}
    
    	preq := ireq // The previous request
    	return func(req *Request) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 06:06:11 UTC 2024
    - 33.7K bytes
    - Viewed (0)
  4. docs/zh/docs/advanced/response-headers.md

    你可以在你的*路径操作函数*中声明一个`Response`类型的参数(就像你可以为cookies做的那样)。
    
    然后你可以在这个*临时*响应对象中设置头部。
    ```Python hl_lines="1  7-8"
    {!../../../docs_src/response_headers/tutorial002.py!}
    ```
    
    然后你可以像平常一样返回任何你需要的对象(例如一个`dict`或者一个数据库模型)。如果你声明了一个`response_model`,它仍然会被用来过滤和转换你返回的对象。
    
    **FastAPI**将使用这个临时响应来提取头部(也包括cookies和状态码),并将它们放入包含你返回的值的最终响应中,该响应由任何`response_model`过滤。
    
    你也可以在依赖项中声明`Response`参数,并在其中设置头部(和cookies)。
    
    ## 直接返回 `Response`
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 2K bytes
    - Viewed (0)
  5. docs/uk/docs/tutorial/cookie-params.md

        ```
    
    !!! note "Технічні Деталі"
        `Cookie` це "сестра" класів `Path` і `Query`. Вони наслідуються від одного батьківського класу `Param`.
        Але пам'ятайте, що коли ви імпортуєте `Query`, `Path`, `Cookie` та інше з `fastapi`, це фактично функції, що повертають спеціальні класи.
    
    !!! info
        Для визначення cookies ви маєте використовувати `Cookie`, тому що в іншому випадку параметри будуть інтерпритовані, як параметри запиту.
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Oct 17 05:59:11 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/cookie-params.md

        ```
    
    !!! note "Technical Details"
        `Cookie` is a "sister" class of `Path` and `Query`. It also inherits from the same common `Param` class.
    
        But remember that when you import `Query`, `Path`, `Cookie` and others from `fastapi`, those are actually functions that return special classes.
    
    !!! info
        To declare cookies, you need to use `Cookie`, because otherwise the parameters would be interpreted as query parameters.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Oct 17 05:59:11 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  7. docs/es/docs/tutorial/cookie-params.md

        ```
    
    !!! note "Detalles Técnicos"
        `Cookie` es una clase "hermana" de `Path` y `Query`. También hereda de la misma clase común `Param`.
    
        Pero recuerda que cuando importas `Query`, `Path`, `Cookie`  y otros de `fastapi`, en realidad son funciones que devuelven clases especiales.
    
    !!! info
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Fri Apr 19 19:30:26 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  8. docs/de/docs/tutorial/cookie-params.md

    # Cookie-Parameter
    
    So wie `Query`- und `Path`-Parameter können Sie auch <abbr title='Cookie – „Keks“: Mechanismus, der kurze Daten in Textform im Browser des Benutzers speichert und abfragt'>Cookie</abbr>-Parameter definieren.
    
    ## `Cookie` importieren
    
    Importieren Sie zuerst `Cookie`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="3"
        {!> ../../../docs_src/cookie_params/tutorial001_an_py310.py!}
        ```
    
    === "Python 3.9+"
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Mar 30 18:02:19 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  9. tests/test_param_include_in_schema.py

                {"hidden_cookie": "somevalue"},
                200,
                {"hidden_cookie": "somevalue"},
            ),
        ],
    )
    def test_hidden_cookie(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
    
    
    @pytest.mark.parametrize(
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  10. docs/es/docs/advanced/response-headers.md

    # Headers de Respuesta
    
    ## Usar un parámetro `Response`
    
    Puedes declarar un parámetro de tipo `Response` en tu *función de operación de path* (de manera similar como se hace con las cookies).
    
    Y entonces, podrás configurar las cookies en ese objeto de response *temporal*.
    
    ```Python hl_lines="1  7-8"
    {!../../../docs_src/response_headers/tutorial002.py!}
    ```
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Feb 07 12:51:12 UTC 2024
    - 2.5K bytes
    - Viewed (0)
Back to top