What is the correct event to create a Response in Puppeteer WebDriver?

Puppeteer

To align with the protocol behavior, create the Response when the responseStarted event fires, rather than after the response is fully received. This makes the Response object available earlier and mirrors how the network start is reported by the underlying CDP. Implement by listening for the responseStarted event in your transport layer and constructing the Response at that moment. Example:

// concept example
client.on('Network.responseStarted', (params) => {
  // instantiate and fill a response object immediately
  const response = new Response(params.requestId);
  response.url = params.response.url;
  response.status = params.response.status;
  // ... fill other properties as needed
});

This approach ensures the response exists as soon as the network response begins, matching the intended behavior.