Version: 1.4.0
REST API
#
REST APIThe server includes a REST API that allows to change dynamically the current behavior, change delay time, and another Mocks Server options .
This is very useful when running acceptance tests, as you can change the behavior of the api simply with a request in your tests before
method.
#
ResourcesAvailable api resources are:
GET
/mocks/behaviors
Returns an array containing all available behaviors.GET
/mocks/behaviors/current
Returns current behavior.PUT
/mocks/behaviors/current
Set current behavior.- Request body example:
{ "name": "behavior-name" }
- Request body example:
GET
/mocks/settings
Return current server settings.- Response body example:
{ "delay": 0 }
- Response body example:
PUT
/mocks/settings
Change current server settings.- Request body example:
{ "delay": 3000 }
- Request body example: