Updated Request Matching (markdown)

Stef Heyenrath
2020-02-11 08:54:23 +01:00
parent dd01ecb18e
commit 195ada4d51

@@ -570,4 +570,40 @@ server
.RespondWith(Response.Create()
.WithStatusCode(HttpStatusCode.Unauthorized)
.WithBody(@"{ ""result"": ""api-key missing""}"));
```
A JSON Mapping example looks like:
``` json
{
"Guid": "29971ff8-4adb-4ec7-8b7d-a2ce6e5ca630",
"Request": {
"Path": {
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "/doesnot-need-a-key"
}
]
},
"Headers": [
{
"Name": "api-key",
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "*",
"IgnoreCase": true,
"RejectOnMatch": true
}
]
}
]
},
"Response": {
"StatusCode": 401,
"BodyDestination": "SameAsSource",
"Body": "{ \"result\": \"api-key missing\"}",
"Headers": {}
}
}
```