mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-06 10:36:39 +00:00
* ✨ Do not require default value in Query(), Path(), Header(), etc * 📝 Update source examples for docs with default and required values * ✅ Update tests with new default values and not required Ellipsis * 📝 Update docs for Query params and update info about default value, required, Ellipsis
14 lines
317 B
Python
14 lines
317 B
Python
from fastapi import FastAPI, File, Form, UploadFile
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.post("/files/")
|
|
async def create_file(
|
|
file: bytes = File(), fileb: UploadFile = File(), token: str = Form()
|
|
):
|
|
return {
|
|
"file_size": len(file),
|
|
"token": token,
|
|
"fileb_content_type": fileb.content_type,
|
|
}
|