Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 1 of 1 for read_item_header (0.06 seconds)

The search processing time has exceeded the limit. The displayed results may be partial.

  1. 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)
Back to Top