Skip to main content
Applies the header to subsequent requests. Without any URL matcher, the header applies to every request. With a matcher, only matching requests get the header.

Parameters

ParameterTypeRequiredDescription
namestringYesHeader name.
valuestringYesHeader value.
substringstringNoMatch URLs that contain this substring.
globstringNoMatch URLs against a glob pattern.
regexstringNoMatch URLs against a regular expression.
domainstringNoMatch all URLs under the given domain.
methodstringNoRestrict the header to a specific HTTP method. Requires a URL matcher.
saveAsstringNoName of the variable to write this step’s return value to.
retriesnumberNoNumber of times to retry the step on failure before failing the test.
skippedbooleanNoSkip this step at execution time.

Examples

- header:
    name: "{{ env.HEADER_NAME_GLOBAL }}"
    value: "{{ env.HEADER_VALUE }}"
- header:
    name: "{{ env.HEADER_NAME_MATCHER_TRUE }}"
    value: "{{ env.HEADER_VALUE }}"
    domain: httpbin.org
- header:
    name: x-feature-flag
    value: "true"
    regex: .+/api/.+