curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/recordings/start \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"targetBaseUrl": "http://example.mocklab.io",
"filters": {
"urlPathPattern": "/api/.*",
"method": "GET"
},
"captureHeaders": {
"Accept": {},
"Content-Type": {
"caseInsensitive": true
}
},
"requestBodyPattern": {
"matcher": "equalToJson",
"ignoreArrayOrder": false,
"ignoreExtraElements": true
},
"extractBodyCriteria": {
"textSizeThreshold": "2048",
"binarySizeThreshold": "10240"
},
"persist": false,
"repeatsAsScenarios": false,
"transformers": [
"modify-response-header"
],
"transformerParameters": {
"headerValue": "123"
}
}
'Begin recording stub mappings
curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/recordings/start \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"targetBaseUrl": "http://example.mocklab.io",
"filters": {
"urlPathPattern": "/api/.*",
"method": "GET"
},
"captureHeaders": {
"Accept": {},
"Content-Type": {
"caseInsensitive": true
}
},
"requestBodyPattern": {
"matcher": "equalToJson",
"ignoreArrayOrder": false,
"ignoreExtraElements": true
},
"extractBodyCriteria": {
"textSizeThreshold": "2048",
"binarySizeThreshold": "10240"
},
"persist": false,
"repeatsAsScenarios": false,
"transformers": [
"modify-response-header"
],
"transformerParameters": {
"headerValue": "123"
}
}
'The ID of the Mock API
5 - 10"jjl8y"
Headers from the request to include in the generated stub mappings, mapped to parameter objects. The only parameter available is "caseInsensitive", which defaults to false
{
"Accept": {},
"Content-Type": { "caseInsensitive": true }
}Criteria for extracting response bodies to a separate file instead of including it in the stub mapping
Show child attributes
Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. "56 Mb". Default unit is bytes.
"18.2 GB"
Size threshold for extracting binary response bodies. Supports humanized size strings, e.g. "56 Mb". Default unit is bytes.
"18.2 GB"
{
"binarySizeThreshold": "1 Mb",
"textSizeThreshold": "2 kb"
}Whether to save stub mappings to the file system or just return them
When true, duplicate requests will be added to a Scenario. When false, duplicates are discarded
Control the request body matcher used in generated stub mappings Automatically determine matcher based on content type (the default)
Show child attributes
If equalTo is used, match body use case-insensitive string comparison
If equalToJson is used, ignore order of array elements
If equalToJson is used, matcher ignores extra elements in objects
auto List of names of stub mappings transformers to apply to generated stubs
Parameters to pass to stub mapping transformers
Filter requests for which to create stub mapping
Show child attributes
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 <= 65535The 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
Show child attributes
Query parameter patterns to match against in the
Show child attributes
application/x-www-form-urlencoded form parameter patterns to match against in the
Show child attributes
Header patterns to match against in the
Show child attributes
Cookie patterns to match against in the
Show child attributes
Request body patterns to match against in the
Require the state of the Mock API to match the provided patterns. More information on this feature can be found here.
Show child attributes
require-state Show child attributes
Show child attributes
The key of the item to match. Cannot be templated.
The context of the item to match. Can be templated.
Multipart patterns to match against headers and body.
Show child attributes
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
Show child attributes
Body patterns to match against in the
"{\n \"urlPath\" : \"/charges\",\n \"method\" : \"POST\",\n \"headers\" : {\n \"Content-Type\" : {\n \"equalTo\" : \"application/json\"\n }\n }\n"
Target URL when using the record and playback API
"https://example.wiremock.org"
Successfully started recording