Coverage for docs_src/request_forms_and_files/tutorial001.py: 100%
5 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-12-04 08:29 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-12-04 08:29 +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 { 1hijklmn
11 "file_size": len(file),
12 "token": token,
13 "fileb_content_type": fileb.content_type,
14 }