Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1241 - 1250 of 1,977 for Fastapi (0.06 sec)

  1. docs/em/docs/tutorial/encoder.md

    # ๐ŸŽป ๐Ÿ”— ๐Ÿ”ข
    
    ๐Ÿ“ค ๐Ÿ’ผ ๐ŸŒโ” ๐Ÿ‘† 5๏ธโƒฃ๐Ÿ“† ๐Ÿ’ช ๐Ÿ—œ ๐Ÿ’ฝ ๐Ÿ†Ž (๐Ÿ’– Pydantic ๐Ÿท) ๐Ÿ•ณ ๐Ÿ”— โฎ๏ธ ๐ŸŽป (๐Ÿ’– `dict`, `list`, โ™’๏ธ).
    
    ๐Ÿ–ผ, ๐Ÿšฅ ๐Ÿ‘† ๐Ÿ’ช ๐Ÿช โšซ๏ธ ๐Ÿ’ฝ.
    
    ๐Ÿ‘ˆ, **FastAPI** ๐Ÿšš `jsonable_encoder()` ๐Ÿ”ข.
    
    ## โš™๏ธ `jsonable_encoder`
    
    โžก๏ธ ๐ŸŒˆ ๐Ÿ‘ˆ ๐Ÿ‘† โœ”๏ธ ๐Ÿ’ฝ `fake_db` ๐Ÿ‘ˆ ๐Ÿ•ด ๐Ÿ“จ ๐ŸŽป ๐Ÿ”— ๐Ÿ’ฝ.
    
    ๐Ÿ–ผ, โšซ๏ธ ๐Ÿšซ ๐Ÿ“จ `datetime` ๐ŸŽš, ๐Ÿ‘ˆ ๐Ÿšซ ๐Ÿ”— โฎ๏ธ ๐ŸŽป.
    
    , `datetime` ๐ŸŽš ๐Ÿ”œ โœ”๏ธ ๐Ÿ—œ `str` โš— ๐Ÿ’ฝ <a href="https://en.wikipedia.org/wiki/ISO_8601" class="external-link" target="_blank">๐Ÿ’พ ๐Ÿ“</a>.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_cookie_params/test_tutorial001_an_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @needs_py310
    @pytest.mark.parametrize(
        "path,cookies,expected_status,expected_response",
        [
            ("/items", None, 200, {"ads_id": None}),
            ("/items", {"ads_id": "ads_track"}, 200, {"ads_id": "ads_track"}),
            (
                "/items",
                {"ads_id": "ads_track", "session": "cookiesession"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.path_operation_advanced_configuration.tutorial007 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv2
    def test_post(client: TestClient):
        yaml_data = """
            name: Deadpoolio
            tags:
            - x-force
            - x-men
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  4. docs_src/query_params_str_validations/tutorial003_py310.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: str | None = Query(default=None, min_length=3, max_length=50)):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 290 bytes
    - Viewed (0)
  5. docs_src/query_params_str_validations/tutorial006b_an.py

    from fastapi import FastAPI, Query
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[str, Query(min_length=3)] = ...):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 310 bytes
    - Viewed (0)
  6. docs/ja/docs/tutorial/path-operation-configuration.md

    {!../../docs_src/path_operation_configuration/tutorial001.py!}
    ```
    
    ใใฎใ‚นใƒ†ใƒผใ‚ฟใ‚นใ‚ณใƒผใƒ‰ใฏใƒฌใ‚นใƒใƒณใ‚นใงไฝฟ็”จใ•ใ‚Œใ€OpenAPIใ‚นใ‚ญใƒผใƒžใซ่ฟฝๅŠ ใ•ใ‚Œใพใ™ใ€‚
    
    /// note | "ๆŠ€่ก“่ฉณ็ดฐ"
    
    ใพใŸใ€`from starlette import status`ใ‚’ไฝฟ็”จใ™ใ‚‹ใ“ใจใ‚‚ใงใใพใ™ใ€‚
    
    **FastAPI** ใฏ้–‹็™บ่€…ใฎๅˆฉไพฟๆ€งใ‚’่€ƒๆ…ฎใ—ใฆใ€`fastapi.status`ใจๅŒใ˜`starlette.status`ใ‚’ๆไพ›ใ—ใฆใ„ใพใ™ใ€‚ใ—ใ‹ใ—ใ€ใ“ใ‚ŒใฏStarletteใ‹ใ‚‰็›ดๆŽฅๆไพ›ใ•ใ‚Œใฆใ„ใพใ™ใ€‚
    
    ///
    
    ## ใ‚ฟใ‚ฐ
    
    `tags`ใƒ‘ใƒฉใƒกใƒผใ‚ฟใ‚’`str`ใฎ`list`๏ผˆ้€šๅธธใฏ๏ผ‘ใคใฎ`str`๏ผ‰ใจไธ€็ท’ใซๆธกใ™ใจใ€*path operation*ใซใ‚ฟใ‚ฐใ‚’่ฟฝๅŠ ใงใใพใ™:
    
    ```Python hl_lines="17  22  27"
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  7. docs_src/query_params_str_validations/tutorial005_an.py

    from fastapi import FastAPI, Query
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[str, Query(min_length=3)] = "fixedquery"):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 319 bytes
    - Viewed (0)
  8. docs_src/request_files/tutorial001_an.py

    from fastapi import FastAPI, File, UploadFile
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(file: Annotated[bytes, File()]):
        return {"file_size": len(file)}
    
    
    @app.post("/uploadfile/")
    async def create_upload_file(file: UploadFile):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 332 bytes
    - Viewed (0)
  9. docs_src/middleware/tutorial001.py

    import time
    
    from fastapi import FastAPI, Request
    
    app = FastAPI()
    
    
    @app.middleware("http")
    async def add_process_time_header(request: Request, call_next):
        start_time = time.perf_counter()
        response = await call_next(request)
        process_time = time.perf_counter() - start_time
        response.headers["X-Process-Time"] = str(process_time)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 06 13:46:39 UTC 2024
    - 365 bytes
    - Viewed (0)
  10. tests/test_regex_deprecated_body.py

    import pytest
    from dirty_equals import IsDict
    from fastapi import FastAPI, Form
    from fastapi.testclient import TestClient
    from typing_extensions import Annotated
    
    from .utils import needs_py310
    
    
    def get_client():
        app = FastAPI()
        with pytest.warns(DeprecationWarning):
    
            @app.post("/items/")
            async def read_items(
                q: Annotated[str | None, Form(regex="^fixedquery$")] = None,
            ):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 6.2K bytes
    - Viewed (0)
Back to top