Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1251 - 1260 of 1,977 for Fastapi (0.07 sec)

  1. docs_src/query_params_str_validations/tutorial009.py

    from typing import Union
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Union[str, None] = Query(default=None, alias="item-query")):
        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
    - 313 bytes
    - Viewed (0)
  2. docs_src/request_forms_and_files/tutorial001_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, File, Form, UploadFile
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_file(
        file: Annotated[bytes, File()],
        fileb: Annotated[UploadFile, File()],
        token: Annotated[str, Form()],
    ):
        return {
            "file_size": len(file),
            "token": token,
            "fileb_content_type": fileb.content_type,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 386 bytes
    - Viewed (0)
  3. docs_src/query_params_str_validations/tutorial003_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Annotated[Union[str, None], Query(min_length=3, max_length=50)] = None,
    ):
        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: Tue Mar 26 16:56:53 UTC 2024
    - 343 bytes
    - Viewed (0)
  4. docs_src/query_params_str_validations/tutorial004_an_py310_regex.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Annotated[
            str | None, Query(min_length=3, max_length=50, regex="^fixedquery$")
        ] = None,
    ):
        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: Tue Oct 24 20:26:06 UTC 2023
    - 366 bytes
    - Viewed (0)
  5. docs_src/header_param_models/tutorial002_py310.py

    from fastapi import FastAPI, Header
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class CommonHeaders(BaseModel):
        model_config = {"extra": "forbid"}
    
        host: str
        save_data: bool
        if_modified_since: str | None = None
        traceparent: str | None = None
        x_tag: list[str] = []
    
    
    @app.get("/items/")
    async def read_items(headers: CommonHeaders = Header()):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 392 bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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)
  9. docs/vi/docs/features.md

    # Tรญnh nฤƒng
    
    ## Tรญnh nฤƒng cแปงa FastAPI
    
    **FastAPI** cho bแบกn nhแปฏng tรญnh nฤƒng sau:
    
    ### Dแปฑa trรชn nhแปฏng tiรชu chuแบฉn mแปŸ
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 06 04:48:30 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  10. docs_src/query_params_str_validations/tutorial007_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        q: Annotated[Union[str, None], Query(title="Query string", min_length=3)] = None,
    ):
        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: Tue Mar 26 16:56:53 UTC 2024
    - 350 bytes
    - Viewed (0)
Back to top