Search Options

Results per page
Sort
Preferred Languages
Advance

Results 361 - 370 of 1,976 for Fastapi (0.08 sec)

  1. docs_src/query_params_str_validations/tutorial014_an.py

    from typing import Union
    
    from fastapi import FastAPI, Query
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(
        hidden_query: Annotated[Union[str, None], Query(include_in_schema=False)] = None,
    ):
        if hidden_query:
            return {"hidden_query": hidden_query}
        else:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Mar 26 16:56:53 UTC 2024
    - 373 bytes
    - Viewed (0)
  2. docs_src/query_params_str_validations/tutorial012_py39.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: list[str] = Query(default=["foo", "bar"])):
        query_items = {"q": q}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 192 bytes
    - Viewed (0)
  3. docs_src/behind_a_proxy/tutorial002.py

    from fastapi import FastAPI, Request
    
    app = FastAPI(root_path="/api/v1")
    
    
    @app.get("/app")
    def read_main(request: Request):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Jun 11 21:53:19 UTC 2020
    - 208 bytes
    - Viewed (0)
  4. docs/ru/docs/tutorial/dependencies/classes-as-dependencies.md

    Таким образом, класс в Python также является **вызываемым**.
    
    Тогда в **FastAPI** в качестве зависимости можно использовать класс Python.
    
    На самом деле FastAPI проверяет, что переданный объект является "вызываемым" (функция, класс или что-либо еще) и указаны  необходимые для его вызова параметры.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 16K bytes
    - Viewed (0)
  5. docs_src/dependency_testing/tutorial001.py

    from typing import Union
    
    from fastapi import Depends, FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    async def common_parameters(
        q: Union[str, None] = None, skip: int = 0, limit: int = 100
    ):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/items/")
    async def read_items(commons: dict = Depends(common_parameters)):
        return {"message": "Hello Items!", "params": commons}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 1.5K bytes
    - Viewed (0)
  6. docs_src/dependency_testing/tutorial001_an_py310.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100):
        return {"q": q, "skip": skip, "limit": limit}
    
    
    @app.get("/items/")
    async def read_items(commons: Annotated[dict, Depends(common_parameters)]):
        return {"message": "Hello Items!", "params": commons}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  7. docs_src/behind_a_proxy/tutorial003.py

    from fastapi import FastAPI, Request
    
    app = FastAPI(
        servers=[
            {"url": "https://stag.example.com", "description": "Staging environment"},
            {"url": "https://prod.example.com", "description": "Production environment"},
        ],
        root_path="/api/v1",
    )
    
    
    @app.get("/app")
    def read_main(request: Request):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 10 17:28:18 UTC 2020
    - 405 bytes
    - Viewed (0)
  8. docs_src/cookie_param_models/tutorial001_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import Cookie, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Cookies(BaseModel):
        session_id: str
        fatebook_tracker: Union[str, None] = None
        googall_tracker: Union[str, None] = None
    
    
    @app.get("/items/")
    async def read_items(cookies: Annotated[Cookies, Cookie()]):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 362 bytes
    - Viewed (0)
  9. docs_src/query_params_str_validations/tutorial003.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, 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: Tue Mar 26 16:56:53 UTC 2024
    - 329 bytes
    - Viewed (0)
  10. docs_src/query_params_str_validations/tutorial006c_an.py

    from typing import Union
    
    from fastapi import FastAPI, Query
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[Union[str, None], 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
    - 349 bytes
    - Viewed (0)
Back to top