mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-07 19:16:43 +00:00
11 lines
311 B
Python
11 lines
311 B
Python
from fastapi import FastAPI
|
|
from starlette.responses import JSONResponse
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/headers/")
|
|
def get_headers():
|
|
content = {"message": "Hello World"}
|
|
headers = {"X-Cat-Dog": "alone in the world", "Content-Language": "en-US"}
|
|
return JSONResponse(content=content, headers=headers)
|