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

9 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2025-12-04 08:29 +0000

1from typing import Annotated 1abcdef

2 

3from fastapi import FastAPI, File, UploadFile 1abcdef

4 

5app = FastAPI() 1abcdef

6 

7 

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

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

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

11 

12 

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

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

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