Updated Proxying (markdown)

Stef Heyenrath
2017-05-07 09:49:29 +02:00
parent f5e75ea2e7
commit 0443188776

@@ -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://<host>:<port>/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: