form-data

422 Unprocessable Entity error when uploading File using JavaScript Fetch API to FastAPI backend

422 Unprocessable Entity error when uploading File using JavaScript Fetch API to FastAPI backend Question: The codes are as shown below. Backend api.py @app.post("/caption") async def caption(image: UploadFile = File(…)) -> str: # produce the caption caption = apiCaption(image) # save the image and caption information status = await apiSaveData(image, caption) return caption if status …

Total answers: 1