Updated Request Matching (markdown)

Stef Heyenrath
2023-08-10 07:59:59 +02:00
parent 568ffb44fd
commit c554646bbb

@@ -1,8 +1,8 @@
# :one: Request Matching
WireMock.Net supports matching of requests to stubs and verification queries using the following parts:
* Path
* URL
* [Path] (#path)
* [URL](#url)
* HTTP Method
* [Query parameters](#query-parameters)
* [Headers](#headers)
@@ -15,10 +15,62 @@ Most matchers have 2 extra properties:
- IgnoreCase = define that the matcher should match ignoring the case
- RejectOnMatch = define that when the matcher does match successfully, this should be counted as a invalid (non-matching) match
## Example Matching for the elements
## Example Matchings
### Path
### C# example
``` c#
server
.Given(Request
.Create()
.WithPath("/test")
```
#### JSON example
``` json
{
"Request": {
"Path": {
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "/path",
"IgnoreCase": true
}
]
}
}
}
````
### Url
### C# example
``` c#
server
.Given(Request
.Create()
.WithUrl("https://localhost/test")
```
#### JSON example
``` json
{
"Request": {
"Url": {
"Matchers": [
{
"Name": "RegexMatcher",
"Pattern": "/clients[?]",
"IgnoreCase": true
}
]
}
}
}
````
### Query Parameters
#### C# excerpt
#### C# example
``` c#
server
.Given(Request
@@ -26,7 +78,7 @@ server
.WithParam("search", "abc")
```
#### JSON excerpt
#### JSON example
``` json
{
"Request": {