File Uploads
Multipart uploads without the curl flags.
Upload files with multipart form data: plain fields and file attachments in YAML, with a filename and content type when the server needs them.
upload.yaml
request:
name: Upload invoice
url: https://api.example.com/invoices
method: POST
formData:
customerId: 42
paid: false
invoice:
file: ./fixtures/invoice.pdf
filename: invoice-2026-10.pdf
contentType: application/pdf
expect:
status: 201Benefits
Fields and files together
Strings, numbers and booleans sit next to file attachments in one formData map.
Control the part
Override the filename the server sees and the part’s content type, per file.
Paths stay in the project
File paths resolve against the working directory and can’t escape it unless you pass --allow-path.
Good for
- Testing avatar and document upload endpoints
- Import endpoints that take a CSV
- Forms that mix metadata with an attachment
- Regression tests for file-size and type limits