♻️ Rename parameter content_type to response_class (#183)

This commit is contained in:
Sebastián Ramírez authored and GitHub committed 2019-04-26 13:11:16 +04:00
1 parent 8880c4cb03
commit 192ebba2a2
6 files changed
+52 -52

No files matched your search

+1 -1
View File
@@ -4,6 +4,6 @@ from starlette.responses import UJSONResponse
app = FastAPI()
@app.get("/items/", content_type=UJSONResponse)
@app.get("/items/", response_class=UJSONResponse)
async def read_items():
return [{"item_id": "Foo"}]
+1 -1
View File
@@ -4,7 +4,7 @@ from starlette.responses import HTMLResponse
app = FastAPI()
@app.get("/items/", content_type=HTMLResponse)
@app.get("/items/", response_class=HTMLResponse)
async def read_items():
return """
<html>
+1 -1
View File
@@ -18,6 +18,6 @@ def generate_html_response():
return HTMLResponse(content=html_content, status_code=200)
@app.get("/items/", content_type=HTMLResponse)
@app.get("/items/", response_class=HTMLResponse)
async def read_items():
return generate_html_response()