Coverage for docs_src/request_forms_and_files/tutorial001.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-08-08 03:53 +0000

1from fastapi import FastAPI, File, Form, UploadFile 1abcde

2 

3app = FastAPI() 1abcde

4 

5 

6@app.post("/files/") 1abcde

7async def create_file( 1abcde

8 file: bytes = File(), fileb: UploadFile = File(), token: str = Form() 

9): 

10 return { 1abcde

11 "file_size": len(file), 

12 "token": token, 

13 "fileb_content_type": fileb.content_type, 

14 }