mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-28 11:17:02 +02: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.
|
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
|
server
|
||||||
.Given(
|
.Given(
|
||||||
Request.Create()
|
Request.Create()
|
||||||
@@ -16,7 +16,7 @@ server
|
|||||||
```
|
```
|
||||||
|
|
||||||
The JSON equivalent would be:
|
The JSON equivalent would be:
|
||||||
```js
|
``` js
|
||||||
{
|
{
|
||||||
"Request": {
|
"Request": {
|
||||||
"Path": {
|
"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.
|
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
|
// Low priority catch-all proxies to otherhost.com by default
|
||||||
server
|
server
|
||||||
.Given(
|
.Given(
|
||||||
|
|||||||
Reference in New Issue
Block a user