- Sort Score
- Num 10 results
- Language All
Results 1 - 1 of 1 for read_item_header (0.2 seconds)
-
docs_src/handling_errors/tutorial002_py310.py
from fastapi import FastAPI, HTTPException app = FastAPI() items = {"foo": "The Foo Wrestlers"} @app.get("/items-header/{item_id}") async def read_item_header(item_id: str): if item_id not in items: raise HTTPException( status_code=404, detail="Item not found", headers={"X-Error": "There goes my error"}, )
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Feb 12 13:19:43 GMT 2026 - 404 bytes - Click Count (0)