- Sort Score
- Result 10 results
- Languages All
Results 61 - 70 of 167 for 404 (0.03 sec)
-
tests/test_tutorial/test_additional_responses/test_tutorial004.py
"openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.0"}, "paths": { "/items/{item_id}": { "get": { "responses": { "404": {"description": "Item not found"}, "302": {"description": "The item was moved"}, "403": {"description": "Not enough privileges"}, "200": {
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 4.8K bytes - Viewed (0) -
docs/en/docs/tutorial/handling-errors.md
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 9.1K bytes - Viewed (0) -
docs_src/app_testing/app_b_an/main.py
if x_token != fake_secret_token: raise HTTPException(status_code=400, detail="Invalid X-Token header") if item_id not in fake_db: raise HTTPException(status_code=404, detail="Item not found") return fake_db[item_id] @app.post("/items/", response_model=Item) async def create_item(item: Item, x_token: Annotated[str, Header()]): if x_token != fake_secret_token:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Aug 15 22:31:16 UTC 2024 - 1.2K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008c_an_py39.py
client = TestClient(app) return client @needs_py39 def test_get_no_item(client: TestClient): response = client.get("/items/foo") assert response.status_code == 404, response.text assert response.json() == {"detail": "Item not found, there's only a plumbus here"} @needs_py39 def test_get(client: TestClient): response = client.get("/items/plumbus")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Feb 24 23:06:37 UTC 2024 - 1.2K bytes - Viewed (0) -
docs/de/docs/advanced/additional-responses.md
**FastAPI** nimmt dieses Modell, generiert dessen JSON-Schema und fügt es an der richtigen Stelle in OpenAPI ein. Um beispielsweise eine weitere Response mit dem Statuscode `404` und einem Pydantic-Modell `Message` zu deklarieren, können Sie schreiben: ```Python hl_lines="18 22" {!../../docs_src/additional_responses/tutorial001.py!} ``` /// note | "Hinweis"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 9.6K bytes - Viewed (0) -
docs/en/docs/advanced/additional-responses.md
**FastAPI** will take that model, generate its JSON Schema and include it in the correct place in OpenAPI. For example, to declare another response with a status code `404` and a Pydantic model `Message`, you can write: {* ../../docs_src/additional_responses/tutorial001.py hl[18,22] *} /// note Keep in mind that you have to return the `JSONResponse` directly. /// /// info
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 16:07:07 UTC 2024 - 8.7K bytes - Viewed (0) -
tests/test_route_scope.py
response = client.post("/users/rick") assert response.status_code == 405, response.text def test_invalid_path_doesnt_match(): response = client.post("/usersx/rick") assert response.status_code == 404, response.text def test_websocket(): with client.websocket_connect("/items/portal-gun") as websocket: data = websocket.receive_json()
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Feb 08 10:23:07 UTC 2023 - 1.5K bytes - Viewed (0) -
docs/de/docs/how-to/conditional-openapi.md
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 2.8K bytes - Viewed (0) -
tests/test_tutorial/test_sql_databases/test_tutorial001.py
assert response.json() == snapshot({"ok": True}) response = client.get(f"/heroes/{hero_id}") assert response.status_code == 404, response.text response = client.delete(f"/heroes/{hero_id}") assert response.status_code == 404, response.text assert response.json() == snapshot({"detail": "Hero not found"}) def test_openapi_schema(client: TestClient):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 14.8K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008b.py
from fastapi.testclient import TestClient from docs_src.dependencies.tutorial008b import app client = TestClient(app) def test_get_no_item(): response = client.get("/items/foo") assert response.status_code == 404, response.text assert response.json() == {"detail": "Item not found"} def test_owner_error(): response = client.get("/items/plumbus") assert response.status_code == 400, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Dec 26 20:37:34 UTC 2023 - 697 bytes - Viewed (0)