Reputation: 303
I am trying to get the HTTP version of a response I get using Puppeteer 1.19.0
. I hoped it was part of the response object but it was not.
Is there a way to retrieve the version like h2
or http/1.1
?
I did not find any pieces of information within the documentation.
Upvotes: 1
Views: 843
Reputation: 8672
You can easily get it with evaluate
function:
await page.goto('https://google.com');
const httpVersion = await page.evaluate(() => performance.getEntries()[0].nextHopProtocol);
console.log('HTTP version: ', httpVersion);
Upvotes: 3