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-02-12 18:15 +0000
« prev ^ index » next coverage.py v7.13.3, created at 2026-02-12 18:15 +0000
1from fastapi import FastAPI, File, Form, UploadFile 1abc
3app = FastAPI() 1abc
6@app.post("/files/") 1abc
7async def create_file( 1abc
8 file: bytes = File(), fileb: UploadFile = File(), token: str = Form()
9):
10 return { 1def
11 "file_size": len(file),
12 "token": token,
13 "fileb_content_type": fileb.content_type,
14 }