For debugging network traffic we often use the web debugging tool Telerik Fiddler. When it comes to debugging web applications in development environments that do REST calls to localhost in the background, these calls will not get tracked by Fiddler. In my case I had a LightSwitch application that uses two service references as data sources. On my development VM the service reference URL points to the same machine (i.e. http://localhost:53224/api/Core
), so these let’s say “inner” requests didn’t get recorded by Fiddler.
To enable recording these requests there are several possibilities offered by Fiddler. In the next section I show you how I solved this problem.
Solution
Instead of doing calls directly to localhost
the calls will be redirected to localhost by Fiddler itself and then they get recorded automatically.
- Replace
http://localhost:123/
in your URI/URL with an arbitrary host name (i.e. http://appclusive/
).
- Start Fiddler
- In the top menu select
Rules
-> Customize rules...

- In the file that gets opened go to the function
OnBeforeRequest(oSession: Session)
- Add a new request modification entry as described here
if (oSession.host == "appclusive") { oSession.host = "localhost:123"; }
- Save rules
-
IMPORTANT: Activate automatic authentication. Otherwise your redirected requests will produce 401 responses because Fiddler won’t do the 401 challenge for you.

-
Restart Fiddler
Now your requests will get recorded and you can debug the whole network traffic!
Like this:
Like Loading...
Related
I'm a software engineer working at isolutions AG