APIs
You can modify the internal state of your server by using some of mockit's built-in APIs.
Get state of server
GET
http://localhost:3000/mockit/api
Gets the internal state of your mock server.
Modify state of server
PUT
http://localhost:3000/mockit/api
Makes updates to the internal state of the server
Headers
Content-Type
object
application/json
Request Body
throttle
string
3G, 4G, WiFi, Disabled
latency
number
When it is set, it will set the server response time to the new latency value.
id
string
The id of a fixture. When it is set, it will set the fixture with that id as active.
Adds a new fixture
POST
http://localhost:3000/mockit/api/new
Creates a new fixture
Request Body
data
object
The response data of the API
status
string
The status of the API
method
string
The method of the API
description
string
The description of the fixture
id
string
The id of the fixture
url
string
The endpoint of the API
Server state reset
PUT
http://localhost:3000/mockit/api/reset
Resets server state back to when it first started
Last updated