Skip to content

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: 201

Benefits

  • 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

  1. Testing avatar and document upload endpoints
  2. Import endpoints that take a CSV
  3. Forms that mix metadata with an attachment
  4. Regression tests for file-size and type limits