HAR (HTTP Archive) is a file format used by several http session tools to export the captured data. The format is basically a JSON object with a particular field distribution. In any case, please note that not all the fields are mandatory, and many times some information won't be saved to the file. Can be also known as a .har file.
HAR files contain sensitive data! For example:
- Content of the pages you downloaded while recording
- Your cookies, which will allow anyone with the HAR file to impersonate your account
- All the information that you submitted while recording: personal details, passwords, credit card numbers, etc.
You can get a capture of a HTTP session in any of the main 3 browsers: IE, Firefox and Chrome, even though we recommend Chrome or Firefox.
You can record your HTTP session using the Network tab in the Developer Tools in Chrome.
- Close all Incognito Windows (if applicable).
- Open a new Incognito Window (use the Customize and Control menu to do this) and go to the URL that needs to be analyzed.
- Open the Developer Tools from the menu (Menu > Tools > developer tools), or by pressing Ctrl+Shift+C on your keyboard.
- Click on the Network tab.
- Look for a round button at the top left of the Network tab. Make sure it is red. If it is grey, click it once to start recording.
- Check the box next to Preserve log.
- You can use the clear button (a circle with a diagonal line through it) right before trying to reproduce the issue to remove unnecessary header information.
- Save the capture by right-clicking on the grid and choosing "Save as HAR with Content".
Starting with Firefox 41, HAR files can be created without any additional extension.
- Close all Private windows (if applicable).
- Open a new Private window session and go to the URL that needs to be analyzed.
- Start Firefox Developer Tools in Network mode (Top right menu > Developer > Network, or ctrl-shift-Q).
- Reproduce the issue.
- Save the capture by right-clicking on the grid and choosing "Save all as HAR".
- Export the capture to a HAR file.
The easiest way is using HttpWatch.
- Download and Install HttpWatch.
- Start the HttpWatch capture right before reproducing the behavior you want to study.
- Stop the HttpWatch capture right after reproducing the behavior to study.
- Export the capture to HAR format.