mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-23 17:28:55 +02:00
Updated Request Matcher : FormUrlEncodedMatcher (markdown)
@@ -4,7 +4,16 @@ Can be used to check if a Form Url Encoded body contains the key-value pairs.
|
|||||||
#### C# option
|
#### C# option
|
||||||
```csharp
|
```csharp
|
||||||
var server = WireMockServer.Start();
|
var server = WireMockServer.Start();
|
||||||
// todo
|
server.Given(
|
||||||
|
Request.Create()
|
||||||
|
.UsingPost()
|
||||||
|
.WithPath("/foo")
|
||||||
|
.WithHeader("Content-Type", "application/x-www-form-urlencoded")
|
||||||
|
.WithBody(new FormUrlEncodedMatcher(["name=John Doe", "email=johndoe@example.com"]))
|
||||||
|
)
|
||||||
|
.RespondWith(
|
||||||
|
Response.Create()
|
||||||
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
#### JSON Mapping option
|
#### JSON Mapping option
|
||||||
@@ -15,7 +24,7 @@ var server = WireMockServer.Start();
|
|||||||
"Matchers": [
|
"Matchers": [
|
||||||
{
|
{
|
||||||
"Name": "WildcardMatcher",
|
"Name": "WildcardMatcher",
|
||||||
"Pattern": "/api"
|
"Pattern": "/foo"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -41,7 +50,8 @@ var server = WireMockServer.Start();
|
|||||||
"grant_type=client_credentials",
|
"grant_type=client_credentials",
|
||||||
"client_id=DDCD99EE1531484E4E21D5EC9FBA5D8B",
|
"client_id=DDCD99EE1531484E4E21D5EC9FBA5D8B",
|
||||||
"client_secret=RERDRDk5RUUxNTMxNDg0RTRFMjFENUVDOUZCQTVEOEI%3D"
|
"client_secret=RERDRDk5RUUxNTMxNDg0RTRFMjFENUVDOUZCQTVEOEI%3D"
|
||||||
]
|
],
|
||||||
|
"IgnoreCase": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user