Updated Request Matching (markdown)

Stef Heyenrath
2022-01-12 18:44:26 +01:00
parent 4944e133d6
commit a88cc4691d

@@ -26,6 +26,7 @@ At this moment these matchers are supported:
* [WildcardMatcher](https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#wildcardmatching-wildcardmatcher)
* ContentTypeMatcher(🚧)
* [NotNullOrEmptyMatcher](https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#notnulloremptymatcher)
* [CustomMatcher](https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#CustomMatcher)
## Exact matcher (ExactMatcher)
Can be used to exactly match a string or object.
@@ -352,6 +353,31 @@ server
### 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).
### CustomMatcher
It's also possible to use a custom mapper with your own name.
#### JSON Mapping Option
``` js
{
"Guid": "67ae335b-5d79-42dc-8ca7-236280ab9211",
"Priority": 0,
"Request": {
"Path": {
"Matchers": [
{
"Name": "MyCustomMatcher",
"Pattern": "abc"
}
]
}
"Body": {}
},
"Response": {
"Body": "custom match"
}
}
```
### Reversing the match behaviour with `MatchBehaviour.RejectOnMatch`