hitspec fetch is the response-body counterpart to hitspec run. It executes
exactly one request and writes exactly one payload. run --output still controls
test reports; fetch --format controls the representation of one response.
Formats
URL credentials are rejected. Query strings are used for the HTTP request but
removed from Markdown and JSON provenance.
raw is the only byte-exact mode.
Ad-hoc request flags
-X/--request, -H/--header, and -d/--data apply only to URL sources. When
--data is present and no method is supplied, the method defaults to POST.
Flag reference
Saved request rules
- A file with multiple requests requires
--nameor the one-based--index. --nameand--indexare mutually exclusive.- The file’s variables, selected environment, dotenv file, request auth, timeout, proxy, TLS, default headers, and body files are resolved normally.
- Assertions, captures, conditions, hooks, shell blocks, database assertions,
and
@waitForare not executed. - A request declaring
@dependsis rejected. Usehitspec runfor a dependent flow rather than fetching an ambiguous partial sequence.
HTTP and file behavior
HTTP 4xx and 5xx responses still emit their body and exit successfully by default. Add--fail to return a non-zero status after the payload has been
written. Transport, timeout, rendering, size-limit, and file errors are always
failures.
The default response limit is 64 MiB; change it with --max-bytes. A response
that crosses the limit fails explicitly and is never silently truncated.
--output-file writes with mode 0600, refuses to follow a destination
symlink, and does not replace an existing file unless --force is supplied.
The final placement is atomic within the destination directory.