Created Request Matcher : FormUrlEncodedMatcher (markdown)

Stef Heyenrath
2024-07-27 11:27:09 +02:00
parent 47285b6d98
commit 983ed9f627

@@ -0,0 +1,60 @@
## FormUrlEncodedMatcher
Can be used to check if a Form Url Encoded body contains the key-value pairs.
#### C# option
```csharp
var server = WireMockServer.Start();
// todo
```
#### JSON Mapping option
``` json
{
"Request": {
"Path": {
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "/api"
}
]
},
"Methods": [
"POST"
],
"Headers": [
{
"Name": "Content-Type",
"Matchers": [
{
"Name": "WildcardMatcher",
"Pattern": "application/x-www-form-urlencoded",
"IgnoreCase": true
}
]
}
],
"Body": {
"Matcher": {
"Name": "FormUrlEncodedMatcher",
"Patterns": [
"grant_type=client_credentials",
"client_id=DDCD99EE1531484E4E21D5EC9FBA5D8B",
"client_secret=RERDRDk5RUUxNTMxNDg0RTRFMjFENUVDOUZCQTVEOEI%3D"
]
}
}
},
"Response": {
"StatusCode": 200,
"BodyAsJson": {
"access_token": "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJjbGllbnRUeXBlIjoiU2VydmVyIiwiYXVkIjoidHJhbnNhY3Rpb24iLCJuYmYiOjE3MjE3MjU2NDMsImV4cCI6MTcyMjMzMDQ0MywiaWF0IjoxNzIxNzI1NjQzfQ.",
"token_type": "Bearer",
"expires_in": 3599
},
"Headers": {
"Content-Type": "application/json"
}
}
}
```