Request Specification
Represents a specification for matching incoming HTTP requests based on defined criteria, such as HTTP method, request path, and request body.
This class is used to define the criteria against which incoming requests are tested. It provides functionality for checking whether a given request satisfies the specified conditions and supports prioritization for defining matching order.
Type Parameters
type of the request payload
Properties
List of matchers for the request body as a String. All matchers must pass for a match to succeed. Note: when both body and bodyString matchers are active, the request body is read twice. The Ktor DoubleReceive plugin must be installed on the server for this to work correctly; without it the second receive() call will fail silently and all matchers in the later group will be treated as not matched.
Matcher for the HTTP method of the request. If null, the method is not validated.
The priority value used for comparing different specifications. Higher values indicate higher priority. Default value is DEFAULT_STUB_PRIORITY (0). Negative values can be used for catch-all / fallback stubs.