- Sort Score
- Result 10 results
- Languages All
Results 91 - 100 of 760 for asyncio (0.03 sec)
-
docs_src/custom_docs_ui/tutorial001_py39.py
) @app.get(app.swagger_ui_oauth2_redirect_url, include_in_schema=False) async def swagger_ui_redirect(): return get_swagger_ui_oauth2_redirect_html() @app.get("/redoc", include_in_schema=False) async def redoc_html(): return get_redoc_html( openapi_url=app.openapi_url, title=app.title + " - ReDoc",
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1.1K bytes - Viewed (0) -
docs_src/request_files/tutorial002_py39.py
app = FastAPI() @app.post("/files/") async def create_files(files: list[bytes] = File()): return {"file_sizes": [len(file) for file in files]} @app.post("/uploadfiles/") async def create_upload_files(files: list[UploadFile]): return {"filenames": [file.filename for file in files]} @app.get("/") async def main(): content = """ <body>
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri May 13 23:38:22 UTC 2022 - 786 bytes - Viewed (0) -
docs_src/handling_errors/tutorial004_py39.py
app = FastAPI() @app.exception_handler(StarletteHTTPException) async def http_exception_handler(request, exc): return PlainTextResponse(str(exc.detail), status_code=exc.status_code) @app.exception_handler(RequestValidationError) async def validation_exception_handler(request, exc: RequestValidationError): message = "Validation errors:" for error in exc.errors():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 920 bytes - Viewed (0) -
docs_src/bigger_applications/app_an_py39/routers/items.py
responses={404: {"description": "Not found"}}, ) fake_items_db = {"plumbus": {"name": "Plumbus"}, "gun": {"name": "Portal Gun"}} @router.get("/") async def read_items(): return fake_items_db @router.get("/{item_id}") async def read_item(item_id: str): if item_id not in fake_items_db: raise HTTPException(status_code=404, detail="Item not found")Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 1011 bytes - Viewed (0) -
docs_src/security/tutorial005_py39.py
@app.get("/users/me/", response_model=User) async def read_users_me(current_user: User = Depends(get_current_active_user)): return current_user @app.get("/users/me/items/") async def read_own_items( current_user: User = Security(get_current_active_user, scopes=["items"]), ): return [{"item_id": "Foo", "owner": current_user.username}] @app.get("/status/")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Mon Sep 29 02:57:38 UTC 2025 - 5.3K bytes - Viewed (0) -
docs_src/security/tutorial003_an_py39.py
return user async def get_current_user(token: Annotated[str, Depends(oauth2_scheme)]): user = fake_decode_token(token) if not user: raise HTTPException( status_code=status.HTTP_401_UNAUTHORIZED, detail="Not authenticated", headers={"WWW-Authenticate": "Bearer"}, ) return user async def get_current_active_user(
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Mon Nov 24 19:03:06 UTC 2025 - 2.5K bytes - Viewed (0) -
tests/test_http_connection_injection.py
from starlette.websockets import WebSocket app = FastAPI() app.state.value = 42 async def extract_value_from_http_connection(conn: HTTPConnection): return conn.app.state.value @app.get("/http") async def get_value_by_http(value: int = Depends(extract_value_from_http_connection)): return value @app.websocket("/ws") async def get_value_by_ws(
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sun Aug 09 13:56:41 UTC 2020 - 972 bytes - Viewed (0) -
docs_src/request_files/tutorial002_an_py39.py
app = FastAPI() @app.post("/files/") async def create_files(files: Annotated[list[bytes], File()]): return {"file_sizes": [len(file) for file in files]} @app.post("/uploadfiles/") async def create_upload_files(files: list[UploadFile]): return {"filenames": [file.filename for file in files]} @app.get("/") async def main(): content = """ <body>
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 826 bytes - Viewed (0) -
docs_src/security/tutorial004_an_py39.py
if user is None: raise credentials_exception return user async def get_current_active_user( current_user: Annotated[User, Depends(get_current_user)], ): if current_user.disabled: raise HTTPException(status_code=400, detail="Inactive user") return current_user @app.post("/token") async def login_for_access_token( form_data: Annotated[OAuth2PasswordRequestForm, Depends()],Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Mon Sep 29 02:57:38 UTC 2025 - 4.2K bytes - Viewed (0) -
docs_src/security/tutorial004_an_py310.py
if user is None: raise credentials_exception return user async def get_current_active_user( current_user: Annotated[User, Depends(get_current_user)], ): if current_user.disabled: raise HTTPException(status_code=400, detail="Inactive user") return current_user @app.post("/token") async def login_for_access_token( form_data: Annotated[OAuth2PasswordRequestForm, Depends()],Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Mon Sep 29 02:57:38 UTC 2025 - 4.1K bytes - Viewed (0)