TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Upload a file with an optional description

POSThttps://api.testingapis.com/api/formdata/uploadSign in to see this endpoint's URL

Request body

Optional. multipart/form-data

Example body
file: @notes.txt
description: Meeting notes
(multipart/form-data; @notes.txt means a file part)

Responses

200
OK
201
File record created.
400
No file sent.

Example

Request
curl -X POST "https://api.testingapis.com/api/formdata/upload" \
  -F "file=@notes.txt" \
  -F "description=Meeting notes" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response201 Created
{"message": "File uploaded", "id": 5, "fileName": "notes.txt", "description": "Meeting notes"}

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.