- Sort Score
- Num 10 results
- Language All
Results 181 - 190 of 795 for asyncId (0.07 seconds)
-
docs_src/bigger_applications/app_an_py310/dependencies.py
from typing import Annotated from fastapi import Header, HTTPException async def get_token_header(x_token: Annotated[str, Header()]): if x_token != "fake-super-secret-token": raise HTTPException(status_code=400, detail="X-Token header invalid") async def get_query_token(token: str): if token != "jessica":
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 409 bytes - Click Count (0) -
docs/fr/docs/tutorial/dependencies/index.md
## Utiliser `async` ou non { #to-async-or-not-to-async } Comme les dépendances seront aussi appelées par **FastAPI** (tout comme vos fonctions de chemins d’accès), les mêmes règles s’appliquent lors de la définition de vos fonctions. Vous pouvez utiliser `async def` ou un `def` normal.Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:37:13 GMT 2026 - 11.1K bytes - Click Count (0) -
tests/test_dependency_duplicates.py
): return [item, sub_item] @app.post("/with-duplicates") async def with_duplicates(item: Item, item2: Item = Depends(duplicate_dependency)): return [item, item2] @app.post("/no-duplicates") async def no_duplicates(item: Item, item2: Item = Depends(dependency)): return [item, item2] @app.post("/with-duplicates-sub") async def no_duplicates_sub(Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 8.8K bytes - Click Count (0) -
docs/tr/docs/tutorial/request-files.md
* Bu, özellikle bir kez `await myfile.read()` çalıştırdıysanız ve sonra içeriği yeniden okumaya ihtiyaç duyuyorsanız faydalıdır. * `close()`: Dosyayı kapatır. Bu method’ların hepsi `async` olduğundan, bunları "await" etmeniz gerekir. Örneğin, bir `async` *path operation function* içinde içeriği şöyle alabilirsiniz: ```Python contents = await myfile.read() ```
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 07:53:17 GMT 2026 - 7.5K bytes - Click Count (0) -
docs/de/docs/tutorial/server-sent-events.md
/// ### Nicht-async-*Pfadoperation-Funktionen* { #non-async-path-operation-functions } Sie können auch normale `def`-Funktionen (ohne `async`) verwenden und `yield` genauso einsetzen. FastAPI stellt sicher, dass sie korrekt ausgeführt wird, sodass sie die Event Loop nicht blockiert. Da die Funktion in diesem Fall nicht async ist, wäre der passende Rückgabetyp `Iterable[Item]`:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:48:21 GMT 2026 - 5.1K bytes - Click Count (0) -
docs/fr/docs/advanced/dataclasses.md
8. Notez que cette *fonction de chemin d'accès* utilise un `def` classique au lieu de `async def`. Comme toujours, avec FastAPI vous pouvez combiner `def` et `async def` selon vos besoins. Si vous avez besoin d'un rappel sur quand utiliser l'un ou l'autre, consultez la section _« In a hurry? »_ dans la documentation à propos de [`async` et `await`](../async.md#in-a-hurry).Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:37:13 GMT 2026 - 4.7K bytes - Click Count (0) -
docs_src/handling_errors/tutorial005_py310.py
@app.exception_handler(RequestValidationError) async def validation_exception_handler(request: Request, exc: RequestValidationError): return JSONResponse( status_code=422, content=jsonable_encoder({"detail": exc.errors(), "body": exc.body}), ) class Item(BaseModel): title: str size: int @app.post("/items/") async def create_item(item: Item):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 626 bytes - Click Count (0) -
docs/de/docs/tutorial/stream-json-lines.md
/// ### Nicht-async *Pfadoperation-Funktionen* { #non-async-path-operation-functions } Sie können auch normale `def`-Funktionen (ohne `async`) verwenden und `yield` auf die gleiche Weise einsetzen. FastAPI stellt sicher, dass sie korrekt ausgeführt werden, sodass der Event Loop nicht blockiert wird. Da die Funktion in diesem Fall nicht async ist, wäre der richtige Rückgabetyp `Iterable[Item]`:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 17:48:21 GMT 2026 - 4.9K bytes - Click Count (0) -
docs_src/handling_errors/tutorial003_py310.py
app = FastAPI() @app.exception_handler(UnicornException) async def unicorn_exception_handler(request: Request, exc: UnicornException): return JSONResponse( status_code=418, content={"message": f"Oops! {exc.name} did something. There goes a rainbow..."}, ) @app.get("/unicorns/{name}") async def read_unicorn(name: str): if name == "yolo": raise UnicornException(name=name)
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 626 bytes - Click Count (0) -
tests/test_route_scope.py
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}") async def websocket_item(item_id: str, websocket: WebSocket): route: APIWebSocketRoute = websocket.scope["route"]
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Sep 29 03:29:38 GMT 2025 - 1.5K bytes - Click Count (0)