Search Options

Results per page
Sort
Preferred Languages
Advance

Results 191 - 200 of 1,916 for FastApi (0.14 sec)

  1. tests/test_route_scope.py

    import pytest
    from fastapi import FastAPI, Request, WebSocket, WebSocketDisconnect
    from fastapi.routing import APIRoute, APIWebSocketRoute
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.get("/users/{user_id}")
    async def get_user(user_id: str, request: Request):
        route: APIRoute = request.scope["route"]
        return {"user_id": user_id, "path": route.path}
    
    
    @app.websocket("/items/{item_id}")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Sep 29 03:29:38 UTC 2025
    - 1.5K bytes
    - Viewed (0)
  2. docs_src/schema_extra_example/tutorial005_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
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        *,
        item_id: int,
        item: Item = Body(
            openapi_examples={
                "normal": {
                    "summary": "A normal example",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  3. docs_src/dependencies/tutorial013_an_py310.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI, HTTPException
    from fastapi.responses import StreamingResponse
    from sqlmodel import Field, Session, SQLModel, create_engine
    
    engine = create_engine("postgresql+psycopg://postgres:postgres@localhost/db")
    
    
    class User(SQLModel, table=True):
        id: int | None = Field(default=None, primary_key=True)
        name: str
    
    
    app = FastAPI()
    
    
    def get_session():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Sep 29 03:29:38 UTC 2025
    - 937 bytes
    - Viewed (0)
  4. docs/en/docs/advanced/middleware.md

    ```
    
    But FastAPI (actually Starlette) provides a simpler way to do it that makes sure that the internal middlewares handle server errors and custom exception handlers work properly.
    
    For that, you use `app.add_middleware()` (as in the example for CORS).
    
    ```Python
    from fastapi import FastAPI
    from unicorn import UnicornMiddleware
    
    app = FastAPI()
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4.4K bytes
    - Viewed (0)
  5. tests/test_router_events.py

    from collections.abc import AsyncGenerator
    from contextlib import asynccontextmanager
    from typing import Union
    
    import pytest
    from fastapi import APIRouter, FastAPI, Request
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    
    class State(BaseModel):
        app_startup: bool = False
        app_shutdown: bool = False
        router_startup: bool = False
        router_shutdown: bool = False
        sub_router_startup: bool = False
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 7.3K bytes
    - Viewed (0)
  6. docs/ru/docs/tutorial/response-model.md

    ### Фильтрация данных FastAPI { #fastapi-data-filtering }
    
    Теперь, для FastAPI: он увидит возвращаемый тип и убедится, что то, что вы возвращаете, включает **только** поля, объявленные в этом типе.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 25.8K bytes
    - Viewed (0)
  7. docs/de/docs/deployment/manually.md

    ## Den `fastapi run` Befehl verwenden { #use-the-fastapi-run-command }
    
    Kurz gesagt, nutzen Sie `fastapi run`, um Ihre FastAPI-Anwendung bereitzustellen:
    
    <div class="termy">
    
    ```console
    $ <font color="#4E9A06">fastapi</font> run <u style="text-decoration-style:solid">main.py</u>
    
      <span style="background-color:#009485"><font color="#D3D7CF"> FastAPI </font></span>  Starting production server 🚀
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Oct 11 17:48:49 UTC 2025
    - 7.6K bytes
    - Viewed (0)
  8. fastapi/utils.py

        Optional,
        Union,
    )
    from weakref import WeakKeyDictionary
    
    import fastapi
    from fastapi._compat import (
        BaseConfig,
        ModelField,
        PydanticSchemaGenerationError,
        Undefined,
        UndefinedType,
        Validator,
        annotation_is_pydantic_v1,
    )
    from fastapi.datastructures import DefaultPlaceholder, DefaultType
    from fastapi.exceptions import FastAPIDeprecationWarning, PydanticV1NotSupportedError
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 12:54:56 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  9. docs/de/docs/tutorial/handling-errors.md

    **FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, nur als Annehmlichkeit für Sie, den Entwickler. Aber die meisten verfügbaren Responses kommen direkt von Starlette. Dasselbe gilt für `Request`.
    
    ///
    
    ## Die Default-Exceptionhandler überschreiben { #override-the-default-exception-handlers }
    
    **FastAPI** hat einige Default-Exceptionhandler.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 10.4K bytes
    - Viewed (0)
  10. docs_src/request_files/tutorial003_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, File, UploadFile
    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    
    @app.post("/files/")
    async def create_files(
        files: Annotated[list[bytes], File(description="Multiple files as bytes")],
    ):
        return {"file_sizes": [len(file) for file in files]}
    
    
    @app.post("/uploadfiles/")
    async def create_upload_files(
        files: Annotated[
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 952 bytes
    - Viewed (0)
Back to top