Use Dev Proxy with .NET applications
.NET automatically uses the system proxy settings. If you want to use Dev Proxy with your .NET application, you don't need to make any changes to your application. Start Dev Proxy and it will automatically intercept web requests made by your .NET application.
Following is a simple .NET app that makes a web request to https://jsonplaceholder.typicode.com/posts
:
var client = new HttpClient();
var response = await client.GetStringAsync("https://jsonplaceholder.typicode.com/posts");
Console.WriteLine(response);
To simulate errors from this request, start Dev Proxy with the default preset, which is configured for intercepting requests to https://jsonplaceholder.typicode.com/*
.
devproxy
When you run your .NET application, Dev Proxy intercepts the request and returns a 429 error.