Files
fastapi__fastapi/docs_src/custom_response/tutorial001.py
T

10 lines
197 B
Python
Raw Normal View History

from fastapi import FastAPI
from fastapi.responses import UJSONResponse
2018-12-15 15:20:22 +04:00
app = FastAPI()
@app.get("/items/", response_class=UJSONResponse)
2018-12-15 15:20:22 +04:00
async def read_items():
return [{"item_id": "Foo"}]