Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 51 - 60 of 392 for cookey (0.21 seconds)

  1. docs_src/cookie_param_models/tutorial001_py310.py

    from fastapi import Cookie, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Cookies(BaseModel):
        session_id: str
        fatebook_tracker: str | None = None
        googall_tracker: str | None = None
    
    
    @app.get("/items/")
    async def read_items(cookies: Cookies = Cookie()):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Sep 17 18:54:10 GMT 2024
    - 303 bytes
    - Click Count (0)
  2. src/test/java/org/codelibs/fess/helper/SearchHelperTest.java

            Cookie[] cookies = getMockResponse().getCookies();
            boolean found = false;
            for (Cookie cookie : cookies) {
                if ("FESS_SEARCH_PARAM".equals(cookie.getName())) {
                    found = true;
                    assertNotNull(cookie.getValue());
                }
            }
            assertTrue(found);
            getMockRequest().addCookie(cookies[0]);
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Fri Mar 13 23:01:26 GMT 2026
    - 19.2K bytes
    - Click Count (0)
  3. tests/test_param_include_in_schema.py

                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(
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 8.6K bytes
    - Click Count (0)
  4. tests/test_request_param_model_by_alias.py

    
    @app.get("/cookie")
    async def cookie_model(data: Model = Cookie()):
        return {"param": data.param}
    
    
    def test_query_model_with_alias():
        client = TestClient(app)
        response = client.get("/query", params={"param_alias": "value"})
        assert response.status_code == 200, response.text
        assert response.json() == {"param": "value"}
    
    
    def test_header_model_with_alias():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 2.1K bytes
    - Click Count (0)
  5. tests/test_request_params/test_cookie/test_optional_str.py

    import pytest
    from fastapi import Cookie, FastAPI
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    from pydantic import BaseModel, Field
    
    app = FastAPI()
    
    # =====================================================================================
    # Without aliases
    
    
    @app.get("/optional-str")
    async def read_optional_str(p: Annotated[str | None, Cookie()] = None):
        return {"p": p}
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 8.6K bytes
    - Click Count (0)
  6. docs_src/cookie_param_models/tutorial002_py310.py

    from fastapi import Cookie, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Cookies(BaseModel):
        model_config = {"extra": "forbid"}
    
        session_id: str
        fatebook_tracker: str | None = None
        googall_tracker: str | None = None
    
    
    @app.get("/items/")
    async def read_items(cookies: Cookies = Cookie()):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Sep 17 18:54:10 GMT 2024
    - 343 bytes
    - Click Count (0)
  7. docs_src/cookie_param_models/tutorial001_an_py310.py

    from typing import Annotated
    
    from fastapi import Cookie, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Cookies(BaseModel):
        session_id: str
        fatebook_tracker: str | None = None
        googall_tracker: str | None = None
    
    
    @app.get("/items/")
    async def read_items(cookies: Annotated[Cookies, Cookie()]):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Sep 17 18:54:10 GMT 2024
    - 343 bytes
    - Click Count (0)
  8. docs_src/response_cookies/tutorial001_py310.py

    from fastapi import FastAPI
    from fastapi.responses import JSONResponse
    
    app = FastAPI()
    
    
    @app.post("/cookie/")
    def create_cookie():
        content = {"message": "Come to the dark side, we have cookies"}
        response = JSONResponse(content=content)
        response.set_cookie(key="fakesession", value="fake-cookie-session-value")
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 344 bytes
    - Click Count (0)
  9. tests/test_query_cookie_header_model_extra_params.py

        client = TestClient(app)
        client.cookies = [
            ("param", "123"),
            ("param2", "456"),  # Pass a list of values as extra parameter
            ("param2", "789"),
        ]
        resp = client.get("/cookie")
        assert resp.status_code == 200
        resp_json = resp.json()
        assert "param2" in resp_json
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sat Dec 20 15:55:38 GMT 2025
    - 2.3K bytes
    - Click Count (0)
  10. tests/test_json_type.py

        assert response.json() == ["abc", "def"]
    
    
    def test_cookie_json_list():
        client.cookies.set("items", json.dumps(["abc", "def"]))
        response = client.get("/cookie-json-list")
        assert response.status_code == 200, response.text
        assert response.json() == ["abc", "def"]
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 05 18:41:43 GMT 2026
    - 1.7K bytes
    - Click Count (0)
Back to Top