How to take an HTTP trace from the client
Published Aug 12 2019 02:34 AM 43.8K Views
Microsoft

Troubleshooting and debugging Web applications starts with a basic question: what does the client experience, and what happens on the server? This article helps answer one of the first questions a troubleshooting professional would ask: what does the client “see” from the server?

Screenshots from the browser or client sometimes provide this answer. But many times, HTTP requests leave the client and responses are received long before a human could collect screen captures. Or maybe it is the sequence that matters, not only one request. And, with AJAX, a client may not display anything relevant at all. So, here we are: we need to collect some HTTP traces; an HTTP traffic recording for investigation.

 

Client and IIS, logs to checkClient and IIS, logs to check

 

 

 

Preferred method – HTTP Watch

 

As a browser add-on, HTTP Watch helps collect all information needed, with minimal interference and in a consistent manner. The steps:

  1. Download HttpWatch – the basic version is free – from www.httpwatch.com/download. It is a good practice to install the latest version.
  2. After installing the tool, launch an Internet Explorer browser. Select to launch a new window, do not just open a new tab; this ensures a new fresh session will be recorded for the target site.
  3. With the new browser instance, press Shift+F2 on the keyboard or select the View > Explorer Bars > HttpWatch Basic from the menu of the browser. This will bring up the HttpWatch extension:
  4. Make sure the Record button is pressed HttpWatch, then navigate and use the web application from the browser as normal, trying to reproduce the issue being investigated. Continue working on the site until you have reproduced.
  5. Once finished, stop and save the trace in HWL format. This is the format that HttpWatch proposes as default.

HttpWatch tool, a brower add-on.png

 

 

 

Second best – Fiddler

 

Fiddler is known as THE tool to be used in troubleshooting from the client side. It has been long used by engineers and developers for its features. But there are a couple of points I want to emphasize.

  • Fiddler becomes a proxy for the system while it runs. And so...
  • It may collect all HTTP traffic on the machine, if not filtered. While sometimes desirable, in most cases it may add some “noise” to the analysis.
  • Because it is a proxy, it may interfere with network configuration or settings. I’ve seen cases where the issue could not be reproduced because of that. Fiddler seemed to be fixing the problem by temporarily changing how traffic is routed.

Steps to take:

  1. Download Fiddler from https://www.telerik.com/download/fiddler and in install.
  2. Before reproducing the problem, you might want to close all browser windows, to start a fresh session.
  3. Start the tool, then the browser or client app. Reproduce the problem.
  4. Do decrypt HTTPS. Don’t forget to decrypt HTTPS. If you send the encrypted session traffic to a support professional, most of the useful information may not be visible. Fiddler would warn about it (see below); alternatively, Menu > Tools > Options > HTTPS tab > Check Decrypt HTTPS traffic.
  5. Finally, Menu > File > Save... you know the drill. Send the resulting trace log file to support.

Fiddler troubleshooting tool.png

 

 

 

Browser’s developer tools, Network tab

 

Finally, using the features of the browser will do, assuming that the client is a browser, of course. There are some drawbacks, such as format inconsistencies from browser to browser.

We need to collect a HAR, HTTP Archive. My personal favorite is Firefox. Chrome may be fine. There is glitch in Egde/IE – they would not start developer tools with a new empty tab.

  1. You might want to close all browser windows, to start a fresh session.
  2. Open the new browser window. Then open its developer tools, going to network tab.
  3. Do enable Persist logs; make sure that the sequence of requests is kept and they don’t disappear with each navigation to a new page.
  4. Reproduce the problem; disabling cache may be relevant.
  5. Save the requests session as HAR, HTTP Archive. Right-click on a request, and the option should show up in the contextual menu.
  6. Send the resulting trace log file to support.

 

Firefox developer tools, network tab.png

 

 

All the best!

Version history
Last update:
‎Oct 25 2019 08:00 AM
Updated by: