mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-25 10:19:04 +02:00
Updated Request Matching (markdown)
@@ -26,6 +26,7 @@ At this moment these matchers are supported:
|
|||||||
* [WildcardMatcher](https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#wildcardmatching-wildcardmatcher)
|
* [WildcardMatcher](https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#wildcardmatching-wildcardmatcher)
|
||||||
* ContentTypeMatcher(🚧)
|
* ContentTypeMatcher(🚧)
|
||||||
* [NotNullOrEmptyMatcher](https://github.com/WireMock-Net/WireMock.Net/wiki/Request-Matching#notnulloremptymatcher)
|
* [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)
|
## Exact matcher (ExactMatcher)
|
||||||
Can be used to exactly match a string or object.
|
Can be used to exactly match a string or object.
|
||||||
@@ -352,6 +353,31 @@ server
|
|||||||
### NotNullOrEmptyMatcher
|
### 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).
|
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`
|
### Reversing the match behaviour with `MatchBehaviour.RejectOnMatch`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user