- Sort Score
- Result 10 results
- Languages All
Results 341 - 350 of 782 for asyncio (1.72 sec)
-
docs_src/header_params/tutorial003_py39.py
from typing import Union from fastapi import FastAPI, Header app = FastAPI() @app.get("/items/") async def read_items(x_token: Union[list[str], None] = Header(default=None)):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat May 14 11:59:59 UTC 2022 - 218 bytes - Viewed (0) -
docs_src/response_model/tutorial003_05_py310.py
from fastapi import FastAPI, Response from fastapi.responses import RedirectResponse app = FastAPI() @app.get("/portal", response_model=None) async def get_portal(teleport: bool = False) -> Response | dict: if teleport: return RedirectResponse(url="https://www.youtube.com/watch?v=dQw4w9WgXcQ")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Jan 10 16:22:47 UTC 2023 - 373 bytes - Viewed (0) -
docs_src/cookie_param_models/tutorial001_an_py39.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Sep 17 18:54:10 UTC 2024 - 362 bytes - Viewed (0) -
docs_src/extra_models/tutorial004_py39.py
description: str items = [ {"name": "Foo", "description": "There comes my hero"}, {"name": "Red", "description": "It's my aeroplane"}, ] @app.get("/items/", response_model=list[Item]) async def read_items():Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jan 07 14:11:31 UTC 2022 - 356 bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial004_regex_an_py310.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 Dec 28 07:19:09 UTC 2025 - Last Modified: Mon Nov 18 02:25:44 UTC 2024 - 366 bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial007_an_py310.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Tue Mar 26 16:56:53 UTC 2024 - 337 bytes - Viewed (0) -
docs_src/query_params_str_validations/tutorial011_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[list[str], None], Query()] = None): query_items = {"q": q}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 237 bytes - Viewed (0) -
docs_src/events/tutorial002_py39.py
from fastapi import FastAPI app = FastAPI() @app.on_event("shutdown") def shutdown_event(): with open("log.txt", mode="a") as log: log.write("Application shutdown") @app.get("/items/") async def read_items():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 255 bytes - Viewed (0) -
docs_src/body_multiple_params/tutorial004_an_py310.py
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: Annotated[int, Body(gt=0)], q: str | None = None, ):Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 643 bytes - Viewed (0) -
docs_src/dependencies/tutorial003_an_py310.py
class CommonQueryParams: def __init__(self, q: str | None = None, skip: int = 0, limit: int = 100): self.q = q self.skip = skip self.limit = limit @app.get("/items/") async def read_items(commons: Annotated[Any, Depends(CommonQueryParams)]): response = {} if commons.q: response.update({"q": commons.q}) items = fake_items_db[commons.skip : commons.skip + commons.limit]Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 655 bytes - Viewed (0)