- Sort Score
- Num 10 results
- Language All
Results 111 - 120 of 795 for asyncId (0.05 seconds)
-
tests/test_strict_content_type_nested.py
inner_strict = APIRouter(prefix="/strict", strict_content_type=True) inner_default = APIRouter(prefix="/default") @inner_strict.post("/items/") async def inner_strict_post(data: dict): return data @inner_default.post("/items/") async def inner_default_post(data: dict): return data outer_router.include_router(inner_strict) outer_router.include_router(inner_default)
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon Feb 23 17:45:20 GMT 2026 - 2.7K bytes - Click Count (0) -
docs_src/dependencies/tutorial008_an_py310.py
from typing import Annotated from fastapi import Depends async def dependency_a(): dep_a = generate_dep_a() try: yield dep_a finally: dep_a.close() async def dependency_b(dep_a: Annotated[DepA, Depends(dependency_a)]): dep_b = generate_dep_b() try: yield dep_b finally: dep_b.close(dep_a) async def dependency_c(dep_b: Annotated[DepB, Depends(dependency_b)]):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 521 bytes - Click Count (0) -
docs_src/dependencies/tutorial001_an_py310.py
from fastapi import Depends, FastAPI app = FastAPI() async def common_parameters(q: 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 commons @app.get("/users/") async def read_users(commons: Annotated[dict, Depends(common_parameters)]):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 454 bytes - Click Count (0) -
tests/test_response_change_status_code.py
from fastapi.testclient import TestClient app = FastAPI() async def response_status_setter(response: Response): response.status_code = 201 async def parent_dep(result=Depends(response_status_setter)): return result @app.get("/", dependencies=[Depends(parent_dep)]) async def get_main(): return {"msg": "Hello World"} client = TestClient(app)
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Apr 08 04:37:38 GMT 2020 - 589 bytes - Click Count (0) -
tests/test_response_model_data_filter_no_inheritance.py
name: str owner: UserDB class PetOut(BaseModel): name: str owner: User @app.post("/users/", response_model=User) async def create_user(user: UserCreate): return user @app.get("/pets/{pet_id}", response_model=PetOut) async def read_pet(pet_id: int): user = UserDB( email="******@****.***", hashed_password="secrethashed", )Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 1.7K bytes - Click Count (0) -
docs/es/docs/tutorial/stream-json-lines.md
/// ### *path operation functions* no-async { #non-async-path-operation-functions } También puedes usar funciones `def` regulares (sin `async`), y usar `yield` de la misma forma. FastAPI se asegurará de que se ejecute correctamente para que no bloquee el event loop. Como en este caso la función no es async, el tipo de retorno correcto sería `Iterable[Item]`:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:12:26 GMT 2026 - 4.6K bytes - Click Count (0) -
docs/en/docs/tutorial/stream-json-lines.md
/// ### Non-async *path operation functions* { #non-async-path-operation-functions } You can also use regular `def` functions (without `async`), and use `yield` the same way. FastAPI will make sure it's run correctly so that it doesn't block the event loop. As in this case the function is not async, the right return type would be `Iterable[Item]`:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 4.3K bytes - Click Count (0) -
tensorflow/c/eager/c_api_remote_test.cc
TestRemoteExecuteSilentCopiesOp(/*async=*/false, /*remote=*/true); } TEST(CAPI, RemoteExecuteSilentCopiesAsync) { TestRemoteExecuteSilentCopiesOp(/*async=*/true, /*remote=*/true); } TEST(CAPI, RemoteExecuteSilentCopiesLocal) { TestRemoteExecuteSilentCopiesOp(/*async=*/false, /*remote=*/false); } TEST(CAPI, RemoteExecuteSilentCopiesLocalAsync) { TestRemoteExecuteSilentCopiesOp(/*async=*/true, /*remote=*/false); }
Created: Tue Apr 07 12:39:13 GMT 2026 - Last Modified: Wed Aug 12 00:14:22 GMT 2020 - 5.4K bytes - Click Count (0) -
docs/uk/docs/tutorial/request-files.md
* Це особливо корисно, якщо ви виконаєте `await myfile.read()` один раз, а потім потрібно знову прочитати вміст. * `close()`: Закриває файл. Оскільки всі ці методи є асинхронними `async` методами, вам потрібно їх «await»-ити. Наприклад, всередині `async` *функції операції шляху* ви можете отримати вміст за допомогою: ```Python contents = await myfile.read() ```
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 19 18:27:41 GMT 2026 - 11K bytes - Click Count (0) -
docs_src/generate_clients/tutorial002_py310.py
async def create_item(item: Item): return {"message": "Item received"} @app.get("/items/", response_model=list[Item], tags=["items"]) async def get_items(): return [ {"name": "Plumbus", "price": 3}, {"name": "Portal Gun", "price": 9001}, ] @app.post("/users/", response_model=ResponseMessage, tags=["users"]) async def create_user(user: User):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 730 bytes - Click Count (0)