From 0443188776f77bffaf561fc9b62124523c58be19 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Sun, 7 May 2017 09:49:29 +0200 Subject: [PATCH] Updated Proxying (markdown) --- Proxying.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Proxying.md b/Proxying.md index 8f6091c..1c244fd 100644 --- a/Proxying.md +++ b/Proxying.md @@ -8,8 +8,16 @@ Proxy responses are defined in exactly the same manner as stubs, meaning that th The following code will proxy all GET requests made to http://:/other/service/.* to http://otherservice.com/approot, e.g. when running WireMock.NET locally a request to http://localhost:9000/other/service/doc/123 would be forwarded to http://otherservice.com/approot/other/service/doc/123. -stubFor(get(urlMatching("/other/service/.*")) - .willReturn(aResponse().proxiedFrom("http://otherhost.com/approot"))); +```csharp +server + .Given( + Request.Create().WithPath("/other/service") + ) + .RespondWith( + Response.Create() + .ProxyFrom("http://otherhost.com/approot") + ); +``` The JSON equivalent would be: