Path vs path + query
It’s important to be clear exactly which part(s) of the URL you wish to match. The default strategy WireMock Cloud uses is to match both the path and query parts of the URL. For instance, if you were you to enter the following in a stub’s URL field:
contains
rater than
exact equality.
To do this, you need to change the URL match type in the Advanced section to Path
and ensure you only specify a path in the URL field e.g.

Match type - exact vs. regular expression
In addition to choosing the URL part(s) you wish to match, you can also choose whether to check for exact equality or a regular expression match. By default WireMock Cloud uses an equality check, but this can be changed in the Advanced section.
Path regex
match type can be particularly useful in cases where
the API you’re mocking uses path parameters and you wish to provide a meaningful response
to a specific URL pattern regardless of the specific parameter values.
For instance, choosing Path regex
as the match type with the following URL
note Using the Path and query regex is generally not advised. This exists primarily for compatibility with projects exported to/from WireMock.
Path template (path parameters)
If you require a stub’s URL to allow dynamic path variables, you can use the path template URL match type. This URL match type provides a convenient way to match URLs whose path segments match certain values and/or a way to reference a request’s dynamic path segments by name in a response template, rather than the usual indexed method (e.g.request.path.thingId
rather than request.path.1
).
To configure a stub to use the path template URL match type, enter a path value that declares one or more path variables
using square bracket syntax (e.g. /things/{thingId}
) and select the “Path template” URL match type.
Now you can add path parameters that match against the value of a request’s path variables.


Matching any URL
In some cases you need a stub to match any request URL. A common use case for this is providing a low priority default response which is matched only if nothing else does. You might also choose to proxy the request to another endpoint in this case. For this purpose use theAny URL
option from the URL match type list under Advanced.