Each item of log.entries is one HTTP request and its response. The
fields below are those of the HAR 1.2 draft. “No” in the Required column means the
draft calls the field optional, and “yes” that it does not; every object may also carry an optional
comment string, left out of the tables below except where it is the
only thing to say. Sizes are in bytes and times in milliseconds.
entry
| Field | Type | Required | Meaning |
|---|---|---|---|
pageref | string | no | The id of the page the request belongs to. Left out when requests are not grouped by page. |
startedDateTime | string | yes | When the request started, ISO 8601 with a time zone. |
time | number | yes | The request’s total time: the sum of the timings, leaving out any that are −1. |
request | object | yes | See request. |
response | object | yes | See response. |
cache | object | yes | See cache; may be an empty object. |
timings | object | yes | See timings. |
serverIPAddress | string | no | The IP address of the server, from the DNS lookup (new in 1.2). |
connection | string | no | An identifier of the TCP/IP connection used, such as the client port number (new in 1.2). |
request
| Field | Type | Required | Meaning |
|---|---|---|---|
method | string | yes | The request method, such as GET or POST. |
url | string | yes | The absolute URL, without the fragment. |
httpVersion | string | yes | Such as HTTP/1.1. |
cookies | array | yes | Cookie objects. |
headers | array | yes | Header objects. |
queryString | array | yes | The parameters of the URL’s query string, as name and value objects. |
postData | object | no | The request body; see postData. |
headersSize | number | yes | Bytes from the start of the request to the blank line after the headers, inclusive; −1 if not known. |
bodySize | number | yes | Bytes of request body; −1 if not known. headersSize plus bodySize is what was sent. |
response
| Field | Type | Required | Meaning |
|---|---|---|---|
status | number | yes | The status code, such as 200. |
statusText | string | yes | The status text, such as OK. |
httpVersion | string | yes | The response’s HTTP version. |
cookies | array | yes | Cookie objects set by the response. |
headers | array | yes | Header objects. |
content | object | yes | The body; see content. |
redirectURL | string | yes | The target of a redirect, from the Location header; empty when none. |
headersSize | number | yes | Bytes of headers received from the server, up to and including the blank line; headers added by the browser’s cache are not counted. −1 if not known. |
bodySize | number | yes | Bytes of body received; 0 for a response served from the cache (status 304). −1 if not known. |
headers and queryString
Both are arrays of objects with name and value strings
(and the optional comment).
postData
| Field | Type | Required | Meaning |
|---|---|---|---|
mimeType | string | yes | The body’s media type. |
params | array | see note | The posted parameters, for URL-encoded or multipart bodies. |
text | string | see note | The body as plain text. |
text and params exclude each other: a body is given one
way or the other. Each item of params:
| Field | Type | Required | Meaning |
|---|---|---|---|
name | string | yes | The parameter’s name. |
value | string | no | Its value, or the content of a posted file. |
fileName | string | no | The name of a posted file. |
contentType | string | no | The media type of a posted file. |
content
| Field | Type | Required | Meaning |
|---|---|---|---|
size | number | yes | The length of the body after decompression. It equals response.bodySize when the body was not compressed, and is larger when it was. |
compression | number | no | Bytes saved by compression. Left out when not known. |
mimeType | string | yes | The Content-Type header’s value, including any charset. |
text | string | no | The body, decoded from any HTTP compression and character set into the file’s UTF-8, or encoded as encoding says. Left out when not available. |
encoding | string | no | How text is encoded, such as base64, which is used for binary bodies. Left out when text is plain decoded text (new in 1.2). |
cache
| Field | Type | Required | Meaning |
|---|---|---|---|
beforeRequest | object or null | no | The cache entry before the request. Left out when not known; null when there was no entry. |
afterRequest | object or null | no | The cache entry after the request, in the same way. |
Each cache entry object:
| Field | Type | Required | Meaning |
|---|---|---|---|
expires | string | no | When the entry expires, ISO 8601. |
lastAccess | string | yes | When the entry was last opened. |
eTag | string | yes | The entry’s ETag. |
hitCount | number | yes | How many times the entry has been opened. |
timings
The phases of the request, in the order they happen, in milliseconds.
| Field | Type | Required | Meaning |
|---|---|---|---|
blocked | number | no | Time waiting in a queue for a network connection; −1 if it does not apply. |
dns | number | no | DNS lookup time; −1 if it does not apply. |
connect | number | no | Time to open the TCP connection; −1 if it does not apply, as when a connection is reused. |
send | number | yes | Time to send the request. Not negative. |
wait | number | yes | Time waiting for the first byte of the response. Not negative. |
receive | number | yes | Time to read the whole response. Not negative. |
ssl | number | no | Time for the TLS handshake; −1 if it does not apply (new in 1.2). It is also counted inside connect, so it is not added again. |
When none is −1, entry.time = blocked + dns +
connect + send + wait +
receive. A program that cannot measure blocked,
dns, connect or ssl may leave them out.
Example
{
"pageref": "page_1",
"startedDateTime": "2023-11-14T22:13:20.123Z",
"time": 85.5,
"request": {
"method": "GET",
"url": "https://example.com/",
"httpVersion": "HTTP/1.1",
"cookies": [],
"headers": [ { "name": "Accept", "value": "text/html" } ],
"queryString": [],
"headersSize": 120,
"bodySize": 0
},
"response": {
"status": 200,
"statusText": "OK",
"httpVersion": "HTTP/1.1",
"cookies": [],
"headers": [ { "name": "Content-Type", "value": "text/html; charset=UTF-8" } ],
"content": { "size": 1256, "mimeType": "text/html; charset=UTF-8", "text": "<!doctype html>…" },
"redirectURL": "",
"headersSize": 310,
"bodySize": 648
},
"cache": {},
"timings": { "blocked": 1.5, "dns": 12, "connect": 30, "ssl": 18, "send": 0.5, "wait": 38, "receive": 3.5 },
"serverIPAddress": "93.184.216.34"
}
time is 1.5 + 12 + 30 + 0.5 + 38 + 3.5 = 85.5; ssl is
already inside connect.