What is a .har file?
application/json
HAR (HTTP Archive) is a JSON format that records a browser or client's network activity. A log object carries the creator, one or more pages, and an ordered list of entries, each holding a full request and response — method, URL, headers, cookies, query string, POST data, status, content, transfer sizes — plus per-phase timings for DNS, connect, send, wait, and receive. Every major browser's developer tools can export one.
How to use a .har file
Use an example .har file to test waterfall viewers, performance-budget checkers, and traffic-replay or mock-server tooling, asserting that entry timings sum to the recorded total and that header, cookie, and body content is parsed without loss.
Download example .har files
- HAR — Page-Load Waterfall (5 Requests)A five-request page load — document, stylesheet, script, image and favicon — across two fictional hosts, with full per-phase timings and an onLoad page timing. Every entry's time equals the sum of its non-negative timing phases, so a waterfall renderer can be checked arithmetically rather than by eye.
- HAR — JSON API Session (GET, POST, PUT, DELETE)A four-call REST session against a fictional API host, with JSON request bodies in postData, an Authorization header carrying an obvious SAMPLE placeholder token, and a 204 response that has no body at all. The right shape for testing a HAR-to-mock-server or HAR-to-code converter.
- HAR — Redirect Chain (301, 302, 200)An http URL that redirects to https and then to a query-carrying cart page, with redirectURL populated on both hops. Tools that count entries as page views report three here when the user saw one page.
- HAR — HTTP Error Responses (401 to 500)Five failing requests covering authentication, authorisation, a missing resource, rate limiting with a Retry-After header, and a server error that returns HTML instead of the JSON the client asked for. The last one is the case that breaks clients which parse by status code rather than by content type.
- HAR — Cookie Set, Sent and ClearedA full session-cookie lifecycle: set at login, echoed on the next request, then expired at logout with Max-Age=0. Both the header and the parsed cookies array are present, and every value — including the form password field — is an obvious SAMPLE placeholder rather than a credential.
- HAR — Server-Bound Waterfall (Wait Dominates)Four API calls in which the wait phase — time to first byte — accounts for almost all of the elapsed time, the signature of a server-bound rather than network-bound page. Use it to check that a performance report attributes the cost to the server instead of blaming connection setup.
- HAR — URL-Encoded Form POSTOne form submission whose postData carries both the parsed params array and the raw urlencoded text — and the two must agree. The notes field contains a comma and an ampersand, so a decoder that splits before unescaping produces seven fields instead of five.
- HAR — Multipart File UploadA two-part multipart/form-data upload: a text file part with a fileName and a plain field part. The body uses CRLF between MIME parts because RFC 7578 requires it, even though the surrounding HAR document is LF-terminated — a distinction that matters when a replay tool rewrites the body.
and 6 more in the library.