- Sort Score
- Num 10 results
- Language All
Results 21 - 30 of 1,151 for Responses (0.08 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
docs/en/docs/tutorial/bigger-applications.md
### Add some custom `tags`, `responses`, and `dependencies` { #add-some-custom-tags-responses-and-dependencies } We are not adding the prefix `/items` nor the `tags=["items"]` to each *path operation* because we added them to the `APIRouter`. But we can still add _more_ `tags` that will be applied to a specific *path operation*, and also some extra `responses` specific to that *path operation*:Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sat Mar 07 09:29:03 GMT 2026 - 19.2K bytes - Click Count (0) -
tests/test_additional_responses_custom_model_in_callback.py
def main_route(callback_url: HttpUrl): pass # pragma: no cover client = TestClient(app) def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == snapshot( { "openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": {
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Wed Feb 04 14:34:02 GMT 2026 - 5.9K bytes - Click Count (0) -
tests/test_annotated.py
client = TestClient(app) response = client.get("/test1") assert response.status_code == 200 assert response.json() == {"foo": "bar"} response = client.get("/test1", params={"var": "baz"}) assert response.status_code == 200 assert response.json() == {"foo": "baz"} response = client.get("/test2") assert response.status_code == 200 assert response.json() == {"foo": "bar"}Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 10.5K bytes - Click Count (0) -
mockwebserver/README.md
from your test's `tearDown()`. ### API #### MockResponse Mock responses default to an empty response body and a `200` status code. You can set a custom body with a string, input stream or byte array. Also add headers with a fluent builder API. ### Java ```java MockResponse response = new MockResponse.Builder() .addHeader("Content-Type", "application/json; charset=utf-8")
Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Thu Oct 30 21:39:59 GMT 2025 - 8.1K bytes - Click Count (0) -
tests/test_pydantic_v1_error.py
detail: str app = FastAPI() with pytest.raises(PydanticV1NotSupportedError): @app.get( "/responses", response_model=None, responses={400: {"model": ErrorModelV1}} ) def endpoint(): # pragma: no cover return {"ok": True} def test_raises_pydantic_v1_model_in_union() -> None: class ModelV1A(BaseModel): name: str app = FastAPI()Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 2.3K bytes - Click Count (0) -
tests/test_extra_routes.py
assert response.headers["x-fastapi-item-id"] == "foo" def test_patch(): response = client.patch("/items/foo", json={"name": "Foo"}) assert response.status_code == 200, response.text assert response.json() == {"item_id": "foo", "item": {"name": "Foo", "price": None}} def test_trace(): response = client.request("trace", "/items/foo") assert response.status_code == 200, response.text
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 14.7K bytes - Click Count (0) -
okhttp-testing-support/src/main/kotlin/okhttp3/internal/RecordingOkAuthenticator.kt
route: Route?, response: Response, ): Request? { if (route == null) throw NullPointerException("route == null") responses += response routes += route if (!schemeMatches(response) || credential == null) return null val header = when (response.code) { 407 -> "Proxy-Authorization" else -> "Authorization" } return response.request .newBuilder()Created: Fri Apr 03 11:42:14 GMT 2026 - Last Modified: Wed Mar 19 19:25:20 GMT 2025 - 1.7K bytes - Click Count (0) -
tests/test_tuples.py
response = client.post("/tuple-of-models/", json=data) assert response.status_code == 422, response.text data = [{"x": 1, "y": 2}] response = client.post("/tuple-of-models/", json=data) assert response.status_code == 422, response.text def test_tuple_form_valid(): response = client.post("/tuple-form/", data={"values": ("1", "2")}) assert response.status_code == 200, response.text
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 10.8K bytes - Click Count (0) -
docs_src/bigger_applications/app_an_py310/routers/items.py
from fastapi import APIRouter, Depends, HTTPException from ..dependencies import get_token_header router = APIRouter( prefix="/items", tags=["items"], dependencies=[Depends(get_token_header)], 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
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 1011 bytes - Click Count (0) -
docs/ko/docs/advanced/path-operation-advanced-configuration.md
{* ../../docs_src/path_operation_advanced_configuration/tutorial004_py310.py hl[17:27] *} ## 추가 응답 { #additional-responses } *경로 처리*에 대해 `response_model`과 `status_code`를 선언하는 방법을 이미 보셨을 것입니다. 이는 *경로 처리*의 기본 응답에 대한 메타데이터를 정의합니다. 모델, 상태 코드 등과 함께 추가 응답도 선언할 수 있습니다. 이에 대한 문서의 전체 장이 있으니, [OpenAPI의 추가 응답](additional-responses.md)에서 읽어보세요. ## OpenAPI Extra { #openapi-extra }Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 14:06:26 GMT 2026 - 7.6K bytes - Click Count (0)