Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 333 for Cookies (0.16 sec)

  1. docs/pt/docs/tutorial/cookie-params.md

    # Parâmetros de Cookie
    
    Você pode definir parâmetros de Cookie da mesma maneira que define paramêtros com `Query` e `Path`.
    
    ## Importe `Cookie`
    
    Primeiro importe `Cookie`:
    
    ```Python hl_lines="3"
    {!../../../docs_src/cookie_params/tutorial001.py!}
    ```
    
    ## Declare parâmetros de `Cookie`
    
    Então declare os paramêtros de cookie usando a mesma estrutura que em `Path` e `Query`.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue May 10 00:09:54 UTC 2022
    - 1.1K bytes
    - Viewed (0)
  2. src/net/http/client_test.go

    			Redirect(w, r, "/", StatusFound)
    		case "1":
    			want = map[string][]string{
    				"Cookie1": {"OldValue1a", "OldValue1b"},
    				"Cookie3": {"OldValue3a", "OldValue3b"},
    				"Cookie4": {"OldValue4"},
    				"Cycle":   {"1"},
    			}
    			SetCookie(w, &Cookie{Name: "Cycle", Value: "2", Path: "/"})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:30:50 UTC 2024
    - 63.8K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. 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)
  6. src/net/http/cookiejar/example_test.go

    		log.Fatal(err)
    	}
    
    	fmt.Println("After 1st request:")
    	for _, cookie := range jar.Cookies(u) {
    		fmt.Printf("  %s: %s\n", cookie.Name, cookie.Value)
    	}
    
    	if _, err = client.Get(u.String()); err != nil {
    		log.Fatal(err)
    	}
    
    	fmt.Println("After 2nd request:")
    	for _, cookie := range jar.Cookies(u) {
    		fmt.Printf("  %s: %s\n", cookie.Name, cookie.Value)
    	}
    	// Output:
    	// After 1st request:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 03:47:00 UTC 2016
    - 1.5K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_response_cookies/test_tutorial001.py

    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.post("/cookie/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Come to the dark side, we have cookies"}
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Jul 09 18:06:12 UTC 2020
    - 403 bytes
    - Viewed (0)
  8. tests/test_tutorial/test_response_cookies/test_tutorial002.py

    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.post("/cookie-and-object/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Come to the dark side, we have cookies"}
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Jul 09 18:06:12 UTC 2020
    - 414 bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top