Search Options

Results per page
Sort
Preferred Languages
Advance

Results 371 - 380 of 1,992 for Fastapi (0.06 sec)

  1. tests/test_starlette_urlconvertors.py

    from fastapi import FastAPI, Path, Query
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.get("/int/{param:int}")
    def int_convertor(param: int = Path()):
        return {"int": param}
    
    
    @app.get("/float/{param:float}")
    def float_convertor(param: float = Path()):
        return {"float": param}
    
    
    @app.get("/path/{param:path}")
    def path_convertor(param: str = Path()):
        return {"path": param}
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sun Nov 27 14:46:06 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  2. docs/pt/docs/tutorial/request-form-models.md

    Isto é suportado desde a versão `0.113.0` do FastAPI. 🤓
    
    ///
    
    ## Modelos Pydantic para Formulários { #pydantic-models-for-forms }
    
    Você precisa apenas declarar um **modelo Pydantic** com os campos que deseja receber como **campos de formulários**, e então declarar o parâmetro como um `Form`:
    
    {* ../../docs_src/request_form_models/tutorial001_an_py39.py hl[9:11,15] *}
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Nov 12 16:23:57 UTC 2025
    - 2.5K bytes
    - Viewed (0)
  3. tests/test_additional_responses_router.py

    from fastapi import APIRouter, FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    
    class ResponseModel(BaseModel):
        message: str
    
    
    app = FastAPI()
    router = APIRouter()
    
    
    @router.get("/a", responses={501: {"description": "Error 1"}})
    async def a():
        return "a"
    
    
    @router.get(
        "/b",
        responses={
            502: {"description": "Error 2"},
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 5.1K bytes
    - Viewed (0)
  4. docs/zh-hant/docs/tutorial/first-steps.md

    而且有許多替代方案,所有這些都是基於 OpenAPI。你可以輕鬆地將任何這些替代方案添加到使用 **FastAPI** 建置的應用程式中。
    
    你也可以用它自動生成程式碼,讓前端、手機應用程式或物聯網設備等與你的 API 進行通訊。
    
    ## 逐步回顧
    
    ### 第一步:引入 `FastAPI`
    
    {* ../../docs_src/first_steps/tutorial001.py h1[1] *}
    
    `FastAPI` 是一個 Python 類別,提供所有 API 的全部功能。
    
    /// note | Technical Details
    
    `FastAPI` 是一個直接繼承自 `Starlette` 的類別。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 11.6K bytes
    - Viewed (0)
  5. docs/fr/docs/deployment/docker.md

    ```Dockerfile
    FROM python:3.7
    
    RUN pip install fastapi uvicorn
    
    EXPOSE 80
    
    COPY ./app /app
    
    CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
    ```
    
    ## Créer le code **FastAPI**.
    
    * Créer un répertoire `app` et y entrer.
    * Créez un fichier `main.py` avec :
    
    ```Python
    from typing import Optional
    
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Nov 09 16:39:20 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  6. docs/ru/docs/features.md

    # Возможности { #features }
    
    ## Возможности FastAPI { #fastapi-features }
    
    **FastAPI** предлагает вам следующее:
    
    ### Основано на открытых стандартах { #based-on-open-standards }
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 16K bytes
    - Viewed (0)
  7. tests/test_http_connection_injection.py

    from fastapi import Depends, FastAPI
    from fastapi.requests import HTTPConnection
    from fastapi.testclient import TestClient
    from starlette.websockets import WebSocket
    
    app = FastAPI()
    app.state.value = 42
    
    
    async def extract_value_from_http_connection(conn: HTTPConnection):
        return conn.app.state.value
    
    
    @app.get("/http")
    async def get_value_by_http(value: int = Depends(extract_value_from_http_connection)):
        return value
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sun Aug 09 13:56:41 UTC 2020
    - 972 bytes
    - Viewed (0)
  8. docs_src/schema_extra_example/tutorial003_an_py310.py

    from typing import Annotated
    
    from fastapi import Body, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        item_id: int,
        item: Annotated[
            Item,
            Body(
                examples=[
                    {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 673 bytes
    - Viewed (0)
  9. docs_src/body/tutorial004_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
    
    
    app = FastAPI()
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item, q: Union[str, None] = None):
        result = {"item_id": item_id, **item.model_dump()}
        if q:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 458 bytes
    - Viewed (0)
  10. docs_src/body_multiple_params/tutorial003_py310.py

    from fastapi import Body, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    class User(BaseModel):
        username: str
        full_name: str | None = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(item_id: int, item: Item, user: User, importance: int = Body()):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 504 bytes
    - Viewed (0)
Back to top