- Sort Score
- Num 10 results
- Language All
Results 91 - 100 of 1,038 for Async (0.07 seconds)
-
docs_src/request_files/tutorial001_02_an_py310.py
from fastapi import FastAPI, File, UploadFile app = FastAPI() @app.post("/files/") async def create_file(file: Annotated[bytes | None, File()] = None): if not file: return {"message": "No file sent"} else: return {"file_size": len(file)} @app.post("/uploadfile/") async def create_upload_file(file: UploadFile | None = None): if not file:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 505 bytes - Click Count (0) -
docs_src/response_model/tutorial001_01_py310.py
class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None tags: list[str] = [] @app.post("/items/") async def create_item(item: Item) -> Item: return item @app.get("/items/") async def read_items() -> list[Item]: return [ Item(name="Portal Gun", price=42.0), Item(name="Plumbus", price=32.0),
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Jan 07 13:45:48 GMT 2023 - 469 bytes - Click Count (0) -
docs_src/metadata/tutorial004_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 693 bytes - Click Count (0) -
docs/en/docs/tutorial/request-files.md
* This is especially useful if you run `await myfile.read()` once and then need to read the contents again. * `close()`: Closes the file. As all these methods are `async` methods, you need to "await" them. For example, inside of an `async` *path operation function* you can get the contents with: ```Python contents = await myfile.read() ```
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 7K bytes - Click Count (0) -
docs_src/path_params/tutorial003_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 236 bytes - Click Count (0) -
docs_src/async_tests/app_a_py310/test_main.py
import pytest from httpx import ASGITransport, AsyncClient from .main import app @pytest.mark.anyio async def test_root(): async with AsyncClient( transport=ASGITransport(app=app), base_url="http://test" ) as ac: response = await ac.get("/") assert response.status_code == 200
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 360 bytes - Click Count (0) -
docs_src/events/tutorial001_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 283 bytes - Click Count (0) -
docs_src/path_operation_configuration/tutorial002b_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 323 bytes - Click Count (0) -
docs_src/request_files/tutorial001_an_py310.py
from typing import Annotated from fastapi import FastAPI, File, UploadFile app = FastAPI() @app.post("/files/") async def create_file(file: Annotated[bytes, File()]): return {"file_size": len(file)} @app.post("/uploadfile/") async def create_upload_file(file: UploadFile):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 322 bytes - Click Count (0) -
docs_src/websockets_/tutorial002_py310.py
input.value = '' event.preventDefault() } </script> </body> </html> """ @app.get("/") async def get(): return HTMLResponse(html) async def get_cookie_or_token( websocket: WebSocket, session: str | None = Cookie(default=None), token: str | None = Query(default=None), ): if session is None and token is None:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 27 12:34:37 GMT 2026 - 2.7K bytes - Click Count (0)