MCPcopy Index your code
hub / github.com/nodejs/node / onClientRequestCreated

Function onClientRequestCreated

lib/internal/inspector/network_http.js:76–94  ·  view source on GitHub ↗

* When a client request is created, emit Network.requestWillBeSent event. * https://chromedevtools.github.io/devtools-protocol/1-3/Network/#event-requestWillBeSent * @param {{ request: import('http').ClientRequest }} event

({ request })

Source from the content-addressed store, hash-verified

74 * @param {{ request: import('http').ClientRequest }} event
75 */
76function onClientRequestCreated({ request }) {
77 request[kInspectorRequestId] = getNextRequestId();
78
79 const { 0: headers, 1: host, 2: charset } = convertHeaderObject(request.getHeaders());
80 const url = getRequestURL(request, host);
81 request[kRequestUrl] = url;
82
83 Network.requestWillBeSent({
84 requestId: request[kInspectorRequestId],
85 timestamp: getMonotonicTime(),
86 wallTime: DateNow(),
87 charset,
88 request: {
89 url,
90 method: request.method,
91 headers,
92 },
93 });
94}
95
96/**
97 * When a client request errors, emit Network.loadingFailed event.

Callers

nothing calls this directly

Calls 5

getNextRequestIdFunction · 0.85
getRequestURLFunction · 0.85
getMonotonicTimeFunction · 0.85
getHeadersMethod · 0.80
convertHeaderObjectFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…