curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"method": "POST",
"url": "/resource",
"headers": {
"Content-Type": {
"matches": ".*/xml"
}
}
}
'import requests
url = "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count"
payload = {
"method": "POST",
"url": "/resource",
"headers": { "Content-Type": { "matches": ".*/xml" } }
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
method: 'POST',
url: '/resource',
headers: {'Content-Type': {matches: '.*/xml'}}
})
};
fetch('https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'POST',
'url' => '/resource',
'headers' => [
'Content-Type' => [
'matches' => '.*/xml'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count"
payload := strings.NewReader("{\n \"method\": \"POST\",\n \"url\": \"/resource\",\n \"headers\": {\n \"Content-Type\": {\n \"matches\": \".*/xml\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"method\": \"POST\",\n \"url\": \"/resource\",\n \"headers\": {\n \"Content-Type\": {\n \"matches\": \".*/xml\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"POST\",\n \"url\": \"/resource\",\n \"headers\": {\n \"Content-Type\": {\n \"matches\": \".*/xml\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"count": 4
}Count requests by criteria
Count requests logged in the journal matching the specified criteria
curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"method": "POST",
"url": "/resource",
"headers": {
"Content-Type": {
"matches": ".*/xml"
}
}
}
'import requests
url = "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count"
payload = {
"method": "POST",
"url": "/resource",
"headers": { "Content-Type": { "matches": ".*/xml" } }
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
method: 'POST',
url: '/resource',
headers: {'Content-Type': {matches: '.*/xml'}}
})
};
fetch('https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'method' => 'POST',
'url' => '/resource',
'headers' => [
'Content-Type' => [
'matches' => '.*/xml'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count"
payload := strings.NewReader("{\n \"method\": \"POST\",\n \"url\": \"/resource\",\n \"headers\": {\n \"Content-Type\": {\n \"matches\": \".*/xml\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"method\": \"POST\",\n \"url\": \"/resource\",\n \"headers\": {\n \"Content-Type\": {\n \"matches\": \".*/xml\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/requests/count")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"method\": \"POST\",\n \"url\": \"/resource\",\n \"headers\": {\n \"Content-Type\": {\n \"matches\": \".*/xml\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"count": 4
}Path Parameters
The ID of the Mock API
5 - 10"jjl8y"
Body
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
^[A-Z]+$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 : { "": "" } 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.
Show child attributes
Show child attributes
Query parameter patterns to match against in the : { "": "" } form
Show child attributes
Show child attributes
application/x-www-form-urlencoded form parameter patterns to match against in the : { "": "" } form
Show child attributes
Show child attributes
Header patterns to match against in the : { "": "" } form
Show child attributes
Show child attributes
Pre-emptive basic auth credentials to match against
Show child attributes
Show child attributes
Cookie patterns to match against in the : { "": "" } form
Show child attributes
Show child attributes
Request body patterns to match against in the : { "": "" } form
- String equals
- Binary equals
- String contains
- String does not contain
- Regular expression match
- Negative regular expression match
- NOT modifier
- Before datetime
- Before datetime
- Before datetime
- JSON equals
- JSONPath match
- XML equality
- XPath match
- JSON Schema match
- Absent matcher
- Logical AND matcher
- Logical AND matcher
- Has exactly multi value matcher
- Has exactly multi value matcher
Show child attributes
Show child attributes
Multipart patterns to match against headers and body.
Show child attributes
Show child attributes
Response
Number of matching requests
4