fastapi/docs/src/custom_response/tutorial001.py
2018-12-21 16:22:33 +04:00

9 lines
197 B
Python

from fastapi import FastAPI
from starlette.responses import UJSONResponse
app = FastAPI()
@app.get("/items/", content_type=UJSONResponse)
async def read_items():
return [{"item_id": "Foo"}]