Coverage for docs_src / request_forms_and_files / tutorial001_py310.py: 100%
5 statements
« prev ^ index » next coverage.py v7.13.3, created at 2026-04-06 01:24 +0000
« prev ^ index » next coverage.py v7.13.3, created at 2026-04-06 01:24 +0000
1from fastapi import FastAPI, File, Form, UploadFile 1abcdefg
3app = FastAPI() 1abcdefg
6@app.post("/files/") 1abcdefg
7async def create_file( 1abcdefg
8 file: bytes = File(), fileb: UploadFile = File(), token: str = Form()
9):
10 return { 1hijk
11 "file_size": len(file),
12 "token": token,
13 "fileb_content_type": fileb.content_type,
14 }