Package org.mockserver.wasm
Class WasmRequest
java.lang.Object
org.mockserver.wasm.WasmRequest
Immutable view of the parts of an HTTP request that a WASM matcher module can
inspect: the
method, path, headers, and body.
This is the input to the richer WASM ABI. Modules that export
match_request(i32 ptr, i32 len) receive a JSON envelope built from this
object; modules that export only the legacy match(i32 ptr, i32 len)
receive just the body bytes (back-compat).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBody()getFirstHeader(String name) First value of the named header (case-insensitive), ornullif absent.getPath()static WasmRequestConvenience factory for a body-only request (legacy behaviour).withHeader(String name, String value) Adds a header value, preserving insertion order and allowing multiple values per name.
-
Constructor Details
-
WasmRequest
-
-
Method Details
-
ofBody
Convenience factory for a body-only request (legacy behaviour). The method and path are empty and there are no headers. -
getMethod
-
getPath
-
getHeaders
-
getFirstHeader
First value of the named header (case-insensitive), ornullif absent. -
getBody
-
withHeader
Adds a header value, preserving insertion order and allowing multiple values per name. Returnsthisfor chaining.
-