title: How can I capture all network requests and full response data when loading a page in Chrome?
body: <p>Using Puppeteer, I'd like to load a URL in Chrome and capture the following information:</p>
  
  <ul>
  <li>request URL</li>
  <li>request headers</li>
  <li>request post data</li>
  <li>response headers text (including duplicate headers like <code>set-cookie</code>)</li>
  <li>transferred response size (i.e. compressed size)</li>
  <li>full response body</li>
  </ul>
  
  <p>Capturing the full response body is what causes the problems for me.</p>
  
  <p>Things I've tried:</p>
  
  <ul>
  <li>Getting response content with <a href="https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#responsebuffer" rel="noreferrer"><code>response.buffer</code></a> - this does not work if there are redirects at any point, since <a href="https://github.com/GoogleChrome/puppeteer/issues/2258" rel="noreferrer">buffers are wiped on navigation</a></li>
  <li>intercepting requests and using <code>getResponseBodyForInterception</code> - this means I can <a href="https://stackoverflow.com/questions/52831249/how-can-i-obtain-the-original-encoded-response-size-when-intercepting-requests-w?answertab=active#tab-top">no longer access the encodedLength</a>, and I also had problems getting the correct request and response headers in some cases</li>
  <li>Using a local proxy works, but this slowed down page load times significantly (and also changed some behavior for e.g. certificate errors)</li>
  </ul>
  
  <p>Ideally the solution should only have a minor performance impact and have no functional differences from loading a page normally. I would also like to avoid forking Chrome.</p>