- Sort Score
- Num 10 results
- Language All
Results 341 - 350 of 1,531 for Responses (0.13 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
docs_src/custom_response/tutorial010_py310.py
from fastapi import FastAPI from fastapi.responses import HTMLResponse app = FastAPI(default_response_class=HTMLResponse) @app.get("/items/") async def read_items():
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 22 16:07:19 GMT 2026 - 228 bytes - Click Count (0) -
tests/test_tutorial/test_additional_responses/test_tutorial002.py
def test_path_operation(client: TestClient): response = client.get("/items/foo") assert response.status_code == 200, response.text assert response.json() == {"id": "foo", "value": "there goes my hero"} @workdir_lock def test_path_operation_img(client: TestClient): shutil.copy("./docs/en/docs/img/favicon.png", "./image.png") response = client.get("/items/foo?img=1") 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 - 5.3K bytes - Click Count (0) -
docs_src/custom_response/tutorial002_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 352 bytes - Click Count (0) -
docs_src/custom_response/tutorial007_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Feb 27 19:12:46 GMT 2026 - 319 bytes - Click Count (0) -
docs_src/custom_response/tutorial008_py310.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 360 bytes - Click Count (0) -
tests/test_tutorial/test_behind_a_proxy/test_tutorial002.py
client = TestClient(app) def test_main(): response = client.get("/app") assert response.status_code == 200 assert response.json() == {"message": "Hello World", "root_path": "/api/v1"} def test_openapi(): response = client.get("/openapi.json") assert response.status_code == 200 assert response.json() == snapshot( { "openapi": "3.1.0",
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 1.1K bytes - Click Count (0) -
tests/test_deprecated_responses.py
app = _make_orjson_app() client = TestClient(app) with warnings.catch_warnings(): warnings.simplefilter("ignore", FastAPIDeprecationWarning) response = client.get("/items") assert response.status_code == 200 assert response.json() == {"name": "widget", "price": 9.99} def test_orjson_response_emits_deprecation_warning():
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 22 16:34:59 GMT 2026 - 2K bytes - Click Count (0) -
tests/test_tutorial/test_body/test_tutorial003.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 6.1K bytes - Click Count (0) -
tests/test_put_no_body.py
client = TestClient(app) def test_put_no_body(): response = client.put("/items/foo") assert response.status_code == 200, response.text assert response.json() == {"item_id": "foo"} def test_put_no_body_with_body(): response = client.put("/items/foo", json={"name": "Foo"}) assert response.status_code == 200, response.text assert response.json() == {"item_id": "foo"} def test_openapi_schema():
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 3.8K bytes - Click Count (0) -
docs_src/additional_status_codes/tutorial001_an_py310.py
from typing import Annotated from fastapi import Body, FastAPI, status 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:
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 686 bytes - Click Count (0)