- Sort Score
- Result 10 results
- Languages All
Results 411 - 420 of 1,962 for fastapi (0.05 sec)
-
docs_src/body_nested_models/tutorial002.py
from typing import List, Union from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None tags: List[str] = [] @app.put("/items/{item_id}") async def update_item(item_id: int, item: Item): results = {"item_id": item_id, "item": item}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat May 14 11:59:59 UTC 2022 - 413 bytes - Viewed (0) -
docs_src/path_operation_configuration/tutorial001.py
from typing import Set, Union from fastapi import FastAPI, status from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None tags: Set[str] = set() @app.post("/items/", response_model=Item, status_code=status.HTTP_201_CREATED) async def create_item(item: Item):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat May 14 11:59:59 UTC 2022 - 406 bytes - Viewed (0) -
docs_src/query_param_models/tutorial001_py39.py
from fastapi import FastAPI, Query from pydantic import BaseModel, Field from typing_extensions import Literal app = FastAPI() class FilterParams(BaseModel): limit: int = Field(100, gt=0, le=100) offset: int = Field(0, ge=0) order_by: Literal["created_at", "updated_at"] = "created_at" tags: list[str] = [] @app.get("/items/") async def read_items(filter_query: FilterParams = Query()):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Sep 17 18:54:10 UTC 2024 - 432 bytes - Viewed (0) -
docs/de/docs/advanced/response-headers.md
**FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Responses kommen aber direkt von Starlette. Und da die `Response` häufig zum Setzen von Headern und Cookies verwendet wird, stellt **FastAPI** diese auch unter `fastapi.Response` bereit. /// ## Benutzerdefinierte Header
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 2.6K bytes - Viewed (0) -
docs/de/docs/advanced/using-request-directly.md
* Dem Pfad als Parameter. * Headern. * Cookies. * usw. Und indem Sie das tun, validiert **FastAPI** diese Daten, konvertiert sie und generiert automatisch Dokumentation für Ihre API. Es gibt jedoch Situationen, in denen Sie möglicherweise direkt auf das `Request`-Objekt zugreifen müssen. ## Details zum `Request`-Objekt
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 2.5K bytes - Viewed (0) -
docs/en/docs/advanced/response-headers.md
**FastAPI** provides the same `starlette.responses` as `fastapi.responses` just as a convenience for you, the developer. But most of the available responses come directly from Starlette. And as the `Response` can be used frequently to set headers and cookies, **FastAPI** also provides it at `fastapi.Response`. /// ## Custom Headers
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 2.2K bytes - Viewed (0) -
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 Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 5.1K bytes - Viewed (0) -
tests/test_allow_inf_nan_in_enforcing.py
import pytest from fastapi import Body, FastAPI, Query from fastapi.testclient import TestClient from typing_extensions import Annotated app = FastAPI() @app.post("/") async def get( x: Annotated[float, Query(allow_inf_nan=True)] = 0, y: Annotated[float, Query(allow_inf_nan=False)] = 0, z: Annotated[float, Query()] = 0, b: Annotated[float, Body(allow_inf_nan=False)] = 0, ) -> str: return "OK"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 24 19:27:37 UTC 2024 - 1.8K bytes - Viewed (0) -
docs_src/dependency_testing/tutorial001_an_py39.py
from typing import Annotated, 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: 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) -
docs_src/request_forms/tutorial001_an.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 233 bytes - Viewed (0)