Coverage for docs_src / request_files / tutorial001_an_py310.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.13.3, created at 2026-02-12 18:15 +0000

1from typing import Annotated 1abc

2 

3from fastapi import FastAPI, File, UploadFile 1abc

4 

5app = FastAPI() 1abc

6 

7 

8@app.post("/files/") 1abc

9async def create_file(file: Annotated[bytes, File()]): 1abc

10 return {"file_size": len(file)} 1defghi

11 

12 

13@app.post("/uploadfile/") 1abc

14async def create_upload_file(file: UploadFile): 1abc

15 return {"filename": file.filename} 1jkl