FastAPI · Class
HTMLResponse
HTMLResponse lets a FastAPI route return HTML. Declare it with response_class to set the HTML media type and document it in OpenAPI.
Last updated
Syntax
HTMLResponse(content=None, status_code=200, headers=None, media_type=None, background=None)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
ResponsePlainTextResponseJSONResponseFileResponseStreamingResponseRedirectResponseJinja2Templates