POST https://api.getpostman.com/mocks/{{mock_uid}}/server-responses
What's a server Stub? Server level responses like 500, 503, etc. are agnostic of application-level logic. This server stub feature allows you to simulate the same behaviour on a mock server as you need not define 5xx errors individually for all paths exposed on your mock server. If you set one of the server stubs as active, then all the calls to the mock server will be returned with that active server stub's response. Let's explore the functionality of this API - This endpoint allows you to create a server response on a mock server. Request body parameters: Note: Multiple server responses can be created for a mock server but only one can be set as active at any point.
key
and value
. The key
field is the header key, and the value
field defines the corresponding value for the header key. e.g:[
{
"key": "Content-Type",
"value": "application/json"
}
]
Body
PARAM
Key | Datatype | Required | Description |
HEADERS
Key | Datatype | Required | Description |
RESPONSES
status OK
{
"createdAt": "2022-05-02T09:38:04.000Z",
"updatedAt": "2022-05-02T09:38:04.000Z",
"id": "7a2cd600-cf51-4e8a-b802-5e458828f4e5",
"name": "Internal server error",
"statusCode": 500,
"headers": [
{
"key": "Content-type",
"value": "application/json"
}
],
"language": null,
"body": "{\n \"message\": \"Something went wrong; please try again in some time.\"\n}",
"createdBy": "1",
"updatedBy": "1",
"mock": "69105a6d-7f3e-4662-b116-f92dad8d9f06"
} |
ENDPOINTS