Skip to main content
The assertion subject is the left-hand side of every expect statement. It specifies which part of the HTTP response to validate.

status

The HTTP response status code as an integer.

duration

The response time in milliseconds (float). Measured from the start of the request to the end of the response.

Percentile Subjects

For stress testing, percentile subjects represent latency distribution:
For single (non-stress) requests, p50, p95, and p99 all equal the duration value. These subjects are most useful in stress testing mode.

Response header values. Use header <name> to access a specific header.
Header names are case-insensitive as per HTTP specification. Using header without a name returns all headers as an object:

body

The full response body. If the response is JSON, body gives you the parsed JSON value. Otherwise, it returns the raw body as a string.

JSON Path Access

Use dot notation to access nested JSON fields:

Array Index Access

Use bracket notation for array indices:

Nested Paths

Combine dot and bracket notation for deep access:

Implicit body Prefix

When the subject doesn’t match a known keyword (status, duration, header, jsonpath, etc.), hitspec treats it as a body path. These are equivalent:

jsonpath

Alternative to body dot-notation using JSONPath-style expressions:
For most cases, the body.path syntax is simpler and recommended. Use jsonpath when you need explicit JSONPath semantics.

Quick Reference

Last modified on February 10, 2026