-
First Check
Commit to Help
Example Codefrom typing import Annotated
from fastapi import FastAPI, UploadFile, Form, File
# Run using uvicorn main:app --reload
# Visit: http://127.0.0.1:8000/docs
app = FastAPI()
@app.post("/form-test")
async def form_test(
str_data: Annotated[str, Form(examples=["HELLO"])],
file: Annotated[UploadFile, File()]):
return DescriptionThe Operating SystemWindows Operating System DetailsNo response FastAPI Version0.108.0 Pydantic Version2.5.3 Python Version3.11.3 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Answered by
Kludex
Jan 21, 2024
Replies: 1 comment
-
I've created #10999 from this discussion. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kludex
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've created #10999 from this discussion.