This is where we create the main part of the response - the response body.
The payload can be pretty much any text format, with a natural preference for XML and JSON.
A binary response payload is hard to create at the moment - sorry.
The payload Content-Type header is defined in the Reaction Properties section and it should match the generated response.
XML payload is used for SOAP and XML services. Some content types that have XML as their base format, e.g. HTTP GET for WSDL, will also use XML payload.
Static XML Payload
To return a static XML payload, simply paste the payload into the payload field:
If the response is quite large, you can also upload it using the input field under the response text area.
Scripted XML Payload
Scripted XML payload is generated using XQuery.
The response XQuery has several variables available, including the request and its properties, mock accounts and meta information. See more about variables here.
Non-XML Payload (Likely JSON)
The response payload can generally be of any text format but the most commonly used is JSON.
The Content-Type of the response is defined in the Reaction Properties section and this controls how the payload will be interpreted by the client.
The response is sent back as UTF-8 by default and the Content-Type HTTP header is modified to include the
Content-Type: application/json; charset=UTF-8
To use a different charset, provide the
charset part in the Content-Type property:
Static JSON Payload
Simply place static JSON payload into the response payload text area:
Note that in this case the content type should most likely be defined as
Static Non-JSON Payload
Scripted JSON Payload
A scripted JSON payload can be created by assigning scripted values to a JSON response payload:
Scripted Non-JSON Payload