From 4749c8d4ee90ce73bdf1d33a3ce96497fcd1a5a0 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Sat, 19 Nov 2022 09:17:19 +0100 Subject: [PATCH] Updated Request Matching (markdown) --- Request-Matching.md | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/Request-Matching.md b/Request-Matching.md index 30a67ed..9893ba3 100644 --- a/Request-Matching.md +++ b/Request-Matching.md @@ -1,14 +1,45 @@ -# Request Matching -WireMock supports matching of requests to stubs and verification queries using the following attributes: +# :one: Request Matching +WireMock.Net supports matching of requests to stubs and verification queries using the following parts: -* Path/URL +* Path +* URL * HTTP Method * Query parameters * Headers * Cookies * Request Body -# Matchers +## Example Matching for the elements + +### Query Parameters +#### C# exceprt +``` c# +server + .Given(Request + .Create() + .WithParam("search", "abc") +``` + +#### JSON exceprt +``` json +{ + "Request": { + "Params": [ + { + "Name": "search", + "Matchers": [ + { + "Name": "ExactMatcher", + "Pattern": "abc" + } + ] + } + ] + } +} +``` + +# :two: Matchers The following paragraphs describe in detail which matchers can be used. At this moment these matchers are supported: