Package org.mockserver.wasm
Class WasmResponse
java.lang.Object
org.mockserver.wasm.WasmResponse
Immutable view of the parts of an HTTP response that a WASM
shape_response module can
read and rewrite: the statusCode, headers, and body.
This is the response half of the WASM host ABI v3 (response shaping). It is used in two directions:
- as input — the response the matched expectation would return, serialised into the shape envelope so the module can inspect it; and
- as output — the (possibly partial) response the module returns, parsed back out of the module's JSON.
Null semantics for the parsed output. A null field means "absent — leave
the materialised response unchanged": a null statusCode leaves the
status untouched, a null/empty headers map adds/overwrites nothing,
and a null body leaves the body unchanged. Present values replace (status
and body) or merge (headers) into the response. See WasmResponseShaper for how the parsed
output is applied.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
WasmResponse
- Parameters:
statusCode- the HTTP status code, ornullwhen absent/unchangedheaders- header name to list of values, ornullwhen absent (never mutated here)body- the response body string, ornullwhen absent/unchanged
-
-
Method Details
-
getStatusCode
-
getHeaders
-
getBody
-