Security
Basic Usage
Add a>>>shell block after your request and assertions:
Variable Interpolation
Variables are resolved in shell commands before execution. You can use environment variables, captured values, and built-in functions:Error Handling
By default, if a shell command fails (returns a non-zero exit code), the test fails. Prefix a command with- to ignore its exit code:
Execution Details
- Commands run via
sh -c - Working directory is the
.httpfile location - Commands execute sequentially in the order they appear
- Each line is a separate command
- Standard output and standard error are captured
Examples
Verify a File Was Created
Run a Cleanup Script
Chain with External Tools
Shell blocks are meant for tasks that cannot be expressed as HTTP assertions. For most validation needs, use the built-in assertion operators instead.