Response Properties
The Response Properties section allows you to modify the response HTTP properties:
HTTP Status Code
By default, a response is sent back with HTTP 200.
However, for some responses, it is a requirement to use a different status. SOAP Fault, for instance, needs to have HTTP 500, and demand for authorization should have HTTP 401.
Content Type
This sets the response Content-Type HTTP header.
By default, MockMotor appends the charset=UTF-8
part to the header. If you need to send the response in another character set, specify this part explicitly:
text/plain; charset=windows-1251
Delay
This delay value is important for load testing.
Static Delay
When the value is 0, MockMotor returns the response as fast as possible.
However, when the value is above 0, MockMotor adds a delay to make the client-visible response time as close to the provided value as possible.
There is a randomization of the response time in a ±10% range.
Scripted Delay
The delay value is scriptable and can use the same variables as the payload field plus response
(aka output
) variable.
For instance, if the real backend takes longer when you pass it multiple accounts, we can set the delay to reflect that.
Here the response time is set to 250ms + extra 500ms for each account:
250 + accounts.length * 500