HTTP
Mocking an HTTP request is very simple and does not require any previous configuration. Just create the Scenarios and try a request to the described endpoint.
HTTP Scenarios
This section describes the fields that are exclusive for HTTP. For all other fields, please refer to Scenarios section.
Name | Mandatory | Description |
---|---|---|
key.method | true | The expected HTTP Verb in upper case (GET, POST, PATCH, DELETE, etc) |
key.pathTemplate | true | An url path that may contains path parameters but no query parameters (/users, /users/{id}). Query parameters should be checked on request.queryParams |
request.headers | false | Headers that will be used to match the Scenario. |
request.pathParams | false | Path params that will be used to match the Scenario. |
request.queryParams | false | Query params that will be used to match the Scenario. |
response.headers | false | Headers that will be sent on the response if this Scenario is elected |
response.status | false | Http status code that will be sent on the response if this Scenario is elected (200, 400, 500, etc) |
defaultResponse.headers | true | Works exactly the same way as response.headers |
defaultResponse.status | true | Works exactly the same way as response.status |
fallbackResponse.headers | false | Works exactly the same way as response.headers . The fallbackResponse field is not mandatory, but if it is present, then this field is mandatory |
fallbackResponse.status | false | Works exactly the same way as response.status . The fallbackResponse field is not mandatory, but if it is present, then this field is mandatory |
callback.typeProperties.url | true | The absolute URL that will be called by the callback. |
callback.typeProperties.method | false | The HTTP verb in upper case (GET, POST, PATCH, DELETE, etc) that will be used to to call the given URL |
callback.typeProperties.headers | false | Headers that will be sent on the callback request |