Skip to main content
Functions let you transform values directly inside a request file without preprocessing. You call them inline using the syntax:
Arguments can be literal strings or variables: bearer(<api_token>).

Built-in functions

bearer(token)

Produces a Bearer <token> string. Use it in the Authorization header instead of writing the prefix manually.
Resolves to Authorization: Bearer abc123 when api_token=abc123 in your environment.

basicAuth(username, password)

Encodes the username and password as a Base64 Basic credential string. Use it in the Authorization header.
Resolves to Authorization: Basic dXNlcjpwYXNz (the Base64 encoding of user:pass).

join(...parts)

Concatenates any number of strings and variables together with no separator.
Resolves to X-Correlation-Id: req-42-abc when user_id=42 and session_id=abc.

readText(path)

Reads a file from disk and inlines its content as the request body. Useful for large JSON payloads or other text content you want to keep in a separate file.

readFile(path)

Reads a binary file from disk and attaches it as a form part in a multipart body. This function is only valid inside a form body — see Request body for usage.
readFile is used in @body form entries, not in headers. Using readFile in a form body automatically switches the content type to multipart/form-data if you haven’t set it explicitly.

Example: authenticated request with functions

This single request uses bearer() to format the token, join() to build a custom header value, and a variable inside a JSON body — all resolved at run time from the active environment.