Fiddler with WebAPI is acting flaky


Fiddler with WebAPI is acting flaky

We have an environment where we are using web-api with .NET CORE and since we can not host it in IIS, we are using fiddler to do a proxy. Now, I have a .NET client which calls this service.
However, the call to the service are very flaky, It can multiple calls back to back and then suddenly stops calling even though nothing changed between the calls. It is in real sense 'flaky'. Not sure what is causing it to behave in inconsistent manner.
I went through some articles and they suggested to have ipv6.fiddler or localhost.fiddler as my URl but nothing seems to be helping.
I also went ahead and updated my config file as mentioned here in Telerik website. That also does not work
Any ideas?


Answer 1:

In my understanding hooking to localhost may not always work.It has been the case for me as well .As the linked article states that

allow the .NET Framework to automatically connect to Fiddler, start Fiddler before starting the .NET application and also

There can be a number of things which can affect the localhost traffic,localhost traffic does not go through your default network interfaces or drivers so that it can correctly captured by network tools (I am referring to tools like wireshark or netmon etc) so it always little tricky to capture localhost traffic.If you want to use localhost in your urls,U have to make sure

  1. Fiddler is started before the application starts so that fiddler can hook into the default proxy
  2. In the application settings,try to rout the traffic through ipv4.fiddler
  3. You can also write a custom proxy easily in .net core and enable it using config switch using .net core proxy

Or an easy or better way is to use machinename instead of the localhost.This will make sure that if fiddler is started as listening as proxy , it will always capture the traffic .

e.g. http://localhost/api may or may not appear in fiddler but http://mymachine/api will always be captured.

Our Awesome Free Tools