Mock APIs
Teams
Organisations
Data sources
Database connections
Usage
Access control
Stub Mappings
- GETGet all stub mappings
- POSTCreate a new stub mapping
- DELDelete all stub mappings
- POSTReset stub mappings
- POSTPersist stub mappings
- POSTImport stub mappings
- GETGet stub mapping by ID
- PUTUpdate a stub mapping
- DELDelete a stub mapping
- POSTFind stub mappings matching metadata
- POSTDelete stub mappings matching metadata
Requests
OpenAPI
Imports
Import into a mock API
Import any supported format into your Mock API. The supplied data will be converted into stubs that your Mock API will be populated with. Supported formats include WireMock mappings JSON files, OpenAPI specifications, Postman collections, HAR (HTTP Archive) logs, WireMock request log JSON files and WireMock directories.
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
The ID of the Mock API
A JSON file containing WireMock stub mappings.
Authorizations
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Path Parameters
The ID of the Mock API
5 - 10
Body
A JSON file containing WireMock stub mappings.
This stub mapping's unique identifier
Alias for the id
The stub mapping's name
The scheme (protocol) part of the request URL
http
, https
The hostname part of the request URL
The HTTP port number of the request URL
1 < x < 65535
The HTTP request method e.g. GET
The path and query to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
The path to match exactly against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
The path regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
The path and query regex to match against. Only one of url, urlPattern, urlPath or urlPathPattern may be specified.
Path parameter patterns to match against in the <key>: { "<predicate>": "<value>" } form. Can only be used when the urlPathPattern URL match type is in use and all keys must be present as variables in the path template.
Require the state of the Mock API to match the provided patterns. More information on this feature can be found here.
Multipart patterns to match against headers and body.
Determines whether all or any of the parts must match the criteria for an overall match.
ALL
, ANY
Header patterns to match against in the <key>: { "<predicate>": "<value>" } form
The HTTP status code to be returned
The HTTP status message to be returned
Map of response headers to send
Extra request headers to send when proxying to another host.
Request headers to remove when proxying to another host.
The response body as a string. Only one of body, base64Body, jsonBody or bodyFileName may be specified.
A base64 encoded string used to describe binary data.
The response body as a JSON object. Only one of body, base64Body, jsonBody or bodyFileName may be specified.
The path to the file containing the response body, relative to the configured file root. Only one of body, base64Body, jsonBody or bodyFileName may be specified.
The fault to apply (instead of a full, valid response).
CONNECTION_RESET_BY_PEER
, EMPTY_RESPONSE
, MALFORMED_RESPONSE_CHUNK
, RANDOM_DATA_THEN_CLOSE
Number of milliseconds to delay be before sending the response.
The delay distribution. Valid property configuration is either median/sigma/type or lower/type/upper.
Read-only flag indicating false if this was the default, unmatched response. Not present otherwise.
The base URL of the target to proxy matching requests to.
A path segment to remove from the beginning in incoming request URL paths before proxying to the target.
Parameters to apply to response transformers.
List of names of transformers to apply to this response.
Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.
This stub mapping's priority relative to others. 1 is highest.
x > 1
The name of the scenario that this stub mapping is part of
The required state of the scenario in order for this stub to be matched.
The new state for the scenario to be updated to after this stub is served.
A map of the names of post serve action extensions to trigger and their parameters.
The list of serve event listeners
change-state
The operation to perform. * SET
- set the value of a state item in the state cache. * DELETE
- delete a state item from the state cache. * REQUEST_VAR
- set a variable that will be available for the lifetime of the request.
SET
, DELETE
, REQUEST_VAR
The context of the item to perform the operation on. Relevant only when operation
is SET
or DELETE
. Can be templated.
The key of the item to perform the operation on. Cannot be templated.
The value to set the item to. Relevant only when operation
is SET
or REQUEST_VAR
. Can be templated.
Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.