Using a proxy to capture http requests in dotnet
Jan 20, 2022
Sometimes you want to use a proxy to capture http requests, for example to check if a specific header is being set. This is easy to accomplish using the postman application, which you probably already have installed.
- Set the environment variable “HTTP_PROXY” to “http://localhost:5555". You can add this in your localSettings.json file for example.
- Enable capturing requests in postman. You can see from the screenshot that port 5555 is being used, the same port as set in step 1. I’ve chosen to record requests in a collection called “Captured”, created explicitly for this purpose.
When you start your application you should see the requests being added to the collection you selected in step 2.