-
Notifications
You must be signed in to change notification settings - Fork 27
NetworkEvent
Events: "update"
URL of the request.
HTTP method of the request, e.g. "GET"
Whether the request is an XHR request.
getRequestHeaders(cb)
Get the request headers for this event. Response properties: headers
, headerSize
.
netEvent.getRequestHeaders(function(err, resp) {
for (var i in resp.headers) {
var header = resp.headers[i];
console.log(header.name + ": " + header.value);
}
});
getRequestCookies(cb)
Get the request cookies for this event:
netEvent.getRequestCookies(function(err, cookies) {
for (var i in cookies) {
var cookie = cookies[i];
console.log(cookie.name + "=" + cookie.value);
}
});
getRequestPostData(cb)
Get the request's POST data, if applicable. Response properties: postData
, postDataDiscarded
.
netEvent.getRequestPostData(function(err, resp) {
console.log("POST data", resp.postData);
});
getResponseHeaders(cb)
Get the response's headers. Response properties: headers
, headersSize
.
netEvent.getResponseHeaders(function(err, resp) {
for (var i in resp.headers) {
var header = resp.headers[i];
console.log(header.name + ": " + header.value);
}
});
getResponseCookies(cb)
Get the request cookies for this event:
netEvent.getRequestCookies(function(err, cookies) {
for (var i in cookies) {
var cookie = cookies[i];
console.log(cookies[i].name + "=" + cookies[i].value);
}
});
getResponseContent(cb)
Get the response body. Response properties: content
, contentDiscarded
(if the body was not recorded).
netEvent.getResponseContent(function(err, resp) {
console.log("response body:", response.content);
});
getEventTimings(cb)
Get the (HAR) timings for this event. Response properties: timings
, totalTime
. timings
is an object with properties: dns
, connect
, send
, wait
, receive
.
netEvent.getEventTimings(function(err, resp) {
console.log("total time:", resp.totalTime);
console.log("DNS resolution time:", resp.timings.dns, "ms");
});
Fired when request headers are available. Event properties: headers
(count of headers), headersSize
(bytes).
Fired when the request cookies are available. Event properties: cookies
(count of cookies).
Fired when the request POST data is available. Event properties: dataSize
(length of data), discardRequestBody
(if the data was not recorded).
Fired when initial response information is available. Event properties response
.
Fired when the response headers are available. Event properties: headers
(number of headers), headerSize
(size in bytes).
Fired when response cookies are available. Event properties: cookies
(number of cookies).
Fired when response body is available. Event properties: mimeType
, contentSize
(bytes), discardResponseBody
Fired when event timing info is available. Event properties: totalTime
(total time of event in ms).