mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-12 05:22:23 +01:00
Updated Request Matching (markdown)
@@ -23,7 +23,8 @@ At this moment these matchers are supported:
|
||||
* [RegexMatcher](https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#regular-expression-matching-regexmatcher)
|
||||
* [SimMetricsMatcher](https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#similarity-metric-matching-simmetricsmatcher)
|
||||
* [WildcardMatcher](https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#wildcardmatching-wildcardmatcher)
|
||||
* [ContentTypeMatcher](todo)
|
||||
* [ContentTypeMatcher](🚧)
|
||||
* [NotNullOrEmptyMatcher](.)
|
||||
|
||||
## Exact matcher (ExactMatcher)
|
||||
Can be used to exactly match a string or object.
|
||||
@@ -325,7 +326,6 @@ The car drives in the street.
|
||||
Hello
|
||||
```
|
||||
|
||||
|
||||
### WildcardMatching (WildcardMatcher)
|
||||
WildcardMatching is mostly used for Path and Url matching. This matcher allows a ? for a single character and * for any characters.
|
||||
|
||||
@@ -348,6 +348,10 @@ server
|
||||
.RespondWith(Response.Create().WithBody("Matched with *"));
|
||||
```
|
||||
|
||||
### NotNullOrEmptyMatcher
|
||||
NotNullOrEmptyMatcher is used for Body matching. This matcher will return a match of the body is not null (BodyAsBytes, BodyAsJson, BodyAsString) or empty (BodyAsBytes, BodyAsString).
|
||||
|
||||
|
||||
### Reversing the match behaviour with `MatchBehaviour.RejectOnMatch`
|
||||
|
||||
The default behaviour for Matchers is MatchBehaviour.AcceptOnMatch so that when the matcher processes a request that corresponds with the matcher, the stubbed response is returned. In some scenarios you might want to reverse this behaviour so that the stubbed response is returned with the absence of a match.
|
||||
|
||||
Reference in New Issue
Block a user