Skip to content

API_MockFactory.MockResponse

Class

apex
global class API_MockFactory.MockResponse

Represents a mock HTTP response with fault simulation options.


Fields

FieldDescription
global String bodyThe response body content (supports {{request.field}} interpolation).
global Map<String, String> headersResponse headers as key-value pairs.
global String statusThe HTTP status text (e.g., "OK", "Internal Server Error").
global Integer statusCodeThe HTTP status code.

body

apex
global String body

Type: String

The response body content (supports {{request.field}} interpolation).

headers

apex
global Map<String, String> headers

Type: Map

Response headers as key-value pairs.

status

apex
global String status

Type: String

The HTTP status text (e.g., "OK", "Internal Server Error").

statusCode

apex
global Integer statusCode

Type: Integer

The HTTP status code.