What is a HAR file and How Is It Generated?

What is a HAR file and How Is It Generated?

HAR files are great for providing additional information about HTTP requests.

Sometimes, when I’m troubleshooting issues on sites, we ask users to send us a HAR file. These are really useful for debugging difficult issues.

This article will help you creating HAR files and give you a little more information about it.

What is a HAR file?

A HAR file records HTTP requests in a JSON format. Some of the recorded information for each HTTP request are:

  • the URL
  • headers
  • cookies
  • request data
  • response
  • timings

HAR files can contain sensitive data, so make sure you store these files securely. 

How to generate a HAR file

One of the easiest ways to generate the HAR file is using Google Chrome. You can follow these steps:

  • Open the page you want to inspect on Google Chrome.
  • Select the Chrome menu at the top-right of the browser window.

chrome menu 1

  • Select More Tools > Developer Tools.
  • On the Developer Tools window, click on the Network tab.

chrome web dev tools 1

  • Check the box “Preserve Log” and make sure it is recording the log (red ball on the left).

chrome recording log 1

  • Refresh the page and navigate, or interact with the page until reproduced the problem you have been experiencing.
  • On the Network tab, click the right button on the list of requests and select “Save as HAR with content”.

chrome save har 1

  • Save the HAR file to a convenient place.

 How to load or analyze the generated file

The HAR file is a text file, so you are able to load it on any Source Code or Text Editor. But in order to get a better visualization of the data, you can use analyzers like the one provided by Google: HAR Analyzer from the G Suit Toolbox

Author

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x