Coverage for docs_src/request_files/tutorial001_an_py39.py: 100%
9 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
1from typing import Annotated 1abcd
3from fastapi import FastAPI, File, UploadFile 1abcd
5app = FastAPI() 1abcd
8@app.post("/files/") 1abcd
9async def create_file(file: Annotated[bytes, File()]): 1abcd
10 return {"file_size": len(file)} 1abcd
13@app.post("/uploadfile/") 1abcd
14async def create_upload_file(file: UploadFile): 1abcd
15 return {"filename": file.filename} 1abcd