Skip to main content

Requests and Bodies

Request Blocks

$ API_ORIGIN = https://api.example.com

---

Fetch user

GET {{ API_ORIGIN }}/users/123

^ & status == 200
& body.user.id -> $USER_ID
  • --- separates the collection preamble from request blocks.
  • A request title names the block for output, dependencies, and captures.
  • The target line, directives, mappings, captures, and assertions all stay in the same block.

Request Target

POST https://example.com/profile

If protocol is omitted, the request is ordinary HTTP.

Later session-backed requests may omit the method and URL line when the protocol supports target inheritance from an earlier step in the same session.

Headers

* header_key = header_value
* header_key = {{ variable_name }}
* header_key = [[ prompt_name ]]

Request-level headers override global preamble headers when the name matches exactly.

Use the same casing when overriding a global header. Case-only differences are not a reliable override.

Query Parameters

? query_key = query_value
? query_key = {{ variable_name }}
? query_key = [[ prompt_name ]]

Multipart Form Data

~ form_key = form_value
~ form_key = {{ variable_name }}
~ form_key = [[ prompt_name ]]
~ form_key = @/path/to/file

Request Body

~~~json
{"id":"123"}
~~~

Use ~~~ [content_type] to define the body block. Protocol-specific authoring may tighten the allowed body forms.

For example:

~~~ application/json
{
"username": "[[ username ]]"
}
~~~

Common Directives

name = Example Collection
description = Basic request set
timeout = 30s
poll_every = 1s
session = web
protocol = graphql

These directives shape how Hen prepares and executes requests while staying in the same line-based authoring model.

Request titles, directives, mappings, captures, and assertions all live in the same request block, so authoring stays close to the behavior being validated.