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

Function onClientRequestBodyChunkSent

lib/internal/inspector/network_undici.js:115–127  ·  view source on GitHub ↗

* When a chunk of the request body is being sent, cache it until `getRequestPostData` request. * https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-getRequestPostData * @param {{ request: undici.Request, chunk: Uint8Array | string }} event

({ request, chunk })

Source from the content-addressed store, hash-verified

113 * @param {{ request: undici.Request, chunk: Uint8Array | string }} event
114 */
115function onClientRequestBodyChunkSent({ request, chunk }) {
116 if (typeof request[kInspectorRequestId] !== 'string') {
117 return;
118 }
119
120 const buffer = Buffer.from(chunk);
121 Network.dataSent({
122 requestId: request[kInspectorRequestId],
123 timestamp: getMonotonicTime(),
124 dataLength: buffer.byteLength,
125 data: buffer,
126 });
127}
128
129/**
130 * Mark a request body as fully sent.

Callers

nothing calls this directly

Calls 2

getMonotonicTimeFunction · 0.85
fromMethod · 0.45

Tested by

no test coverage detected