- Sort Score
- Num 10 results
- Language All
Results 331 - 340 of 500 for defa (0.01 seconds)
-
fastapi/security/utils.py
def get_authorization_scheme_param( authorization_header_value: str | None, ) -> tuple[str, str]: if not authorization_header_value: return "", "" scheme, _, param = authorization_header_value.partition(" ")
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Feb 11 18:41:21 GMT 2026 - 261 bytes - Click Count (0) -
docs_src/additional_status_codes/tutorial001_an_py310.py
from fastapi.responses import JSONResponse app = FastAPI() items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}} @app.put("/items/{item_id}") async def upsert_item( item_id: str, name: Annotated[str | None, Body()] = None, size: Annotated[int | None, Body()] = None, ): if item_id in items: item = items[item_id] item["name"] = name
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 686 bytes - Click Count (0) -
tests/test_tutorial/test_background_tasks/test_tutorial001.py
from pathlib import Path from fastapi.testclient import TestClient from docs_src.background_tasks.tutorial001_py310 import app from tests.utils import workdir_lock client = TestClient(app) @workdir_lock def test(): log = Path("log.txt") if log.is_file(): os.remove(log) # pragma: no cover response = client.post("/send-notification/******@****.***") assert response.status_code == 200, response.text
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 27 10:53:47 GMT 2026 - 635 bytes - Click Count (0) -
docs_src/cookie_params/tutorial001_py310.py
from fastapi import Cookie, FastAPI app = FastAPI() @app.get("/items/") async def read_items(ads_id: str | None = Cookie(default=None)):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 170 bytes - Click Count (0) -
docs_src/configure_swagger_ui/tutorial001_py310.py
from fastapi import FastAPI app = FastAPI(swagger_ui_parameters={"syntaxHighlight": False}) @app.get("/users/{username}") async def read_user(username: str):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 205 bytes - Click Count (0) -
docs_src/configure_swagger_ui/tutorial003_py310.py
from fastapi import FastAPI app = FastAPI(swagger_ui_parameters={"deepLinking": False}) @app.get("/users/{username}") async def read_user(username: str):
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 201 bytes - Click Count (0) -
docs_src/custom_response/tutorial009_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 202 bytes - Click Count (0) -
docs_src/custom_response/tutorial009b_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 217 bytes - Click Count (0) -
tests/test_operations_signatures.py
import inspect from fastapi import APIRouter, FastAPI method_names = ["get", "put", "post", "delete", "options", "head", "patch", "trace"] def test_signatures_consistency(): base_sig = inspect.signature(APIRouter.get) for method_name in method_names: router_method = getattr(APIRouter, method_name) app_method = getattr(FastAPI, method_name) router_sig = inspect.signature(router_method)
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Mon May 27 12:08:13 GMT 2019 - 934 bytes - Click Count (0) -
fastapi/openapi/docs.py
import json from typing import Annotated, Any from annotated_doc import Doc from fastapi.encoders import jsonable_encoder from starlette.responses import HTMLResponse def _html_safe_json(value: Any) -> str: """Serialize a value to JSON with HTML special characters escaped. This prevents injection when the JSON is embedded inside a <script> tag. """ return ( json.dumps(value) .replace("<", "\\u003c")
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 24 09:28:10 GMT 2026 - 12.1K bytes - Click Count (0)