mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-24 18:11:10 +01:00
Updated Proxying (markdown)
@@ -3,7 +3,7 @@ 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.
|
||||
|
||||
```csharp
|
||||
``` c#
|
||||
server
|
||||
.Given(
|
||||
Request.Create()
|
||||
@@ -16,7 +16,7 @@ server
|
||||
```
|
||||
|
||||
The JSON equivalent would be:
|
||||
```js
|
||||
``` js
|
||||
{
|
||||
"Request": {
|
||||
"Path": {
|
||||
@@ -42,7 +42,7 @@ The JSON equivalent would be:
|
||||
|
||||
The proxy/intercept pattern described above is achieved by adding a low priority proxy mapping with a broad URL match and any number of higher priority stub mappings e.g.
|
||||
|
||||
```csharp
|
||||
``` c#
|
||||
// Low priority catch-all proxies to otherhost.com by default
|
||||
server
|
||||
.Given(
|
||||
|
||||
Reference in New Issue
Block a user