Skip to main content

Multipart Form Data

Source file: examples/multipart_form_data.hen

What It Demonstrates​

  • ~ key = value multipart text fields
  • ~ key = @path file uploads
  • assertions against multipart echo responses

Key Pattern​

POST https://postman-echo.com/post

~ description = syntax reference sample
~ attachment = @../syntax-reference.md

^ & body.form.description == 'syntax reference sample'
^ & body.files != null

Run It​

hen verify ./examples/multipart_form_data.hen
hen run ./examples/multipart_form_data.hen all --non-interactive

What To Notice​

  • Hen constructs the multipart request for you.
  • File paths are resolved relative to the collection file.
  • The same collection shows both simple text fields and file uploads.

Related reference: Requests and bodies