What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Listen for the page’s request event and call request.headers(). This reads outgoing request headers without enabling interception. In Puppeteer 25.12.0, the returned object uses lowercase header names, such as content-type.
Read headers from Puppeteer requests
Register the listener before navigating so it can observe the navigation request and subsequent page traffic:
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
page.on('request', request => {
console.log(request.url(), request.headers());
});
await page.goto('https://example.com');
} finally {
await browser.close();
}
The callback receives an HTTPRequest. Its headers() method returns a record of header names and values associated with that outgoing request. The pattern works with the standard request events; passive logging does not require request interception. See the HTTPRequest.headers() reference and the network logging guide.
CommonJS version
If your project uses CommonJS, replace the import with const puppeteer = require('puppeteer');. Keep the same listener and navigation pattern.
#1 Best Overall
Read a particular header
Header names in the returned object are lowercase, so use lowercase keys when accessing them:
page.on('request', request => {
const headers = request.headers();
console.log(headers['content-type']);
});
HTTP header names are case-insensitive on the wire, but JavaScript object property names are not. Looking up headers['Content-Type'] will not match a returned content-type key.
Rank #2
Request headers versus response headers
request.headers() describes headers associated with an outgoing request from the page. To inspect information sent back by a server, listen for the response event and use the response API instead. Puppeteer’s request and response events are distinct; choose based on which direction of traffic you mean.
HTTP status errors are not necessarily network failures: a request receiving a 404 or 503 is still treated as completed and emits requestfinished, not requestfailed solely because of that status. Redirects finish one request and create a new request for the redirected URL. These distinctions matter when correlating logged headers with outcomes. See the HTTPRequest class reference.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Do you need request interception?
No, not to observe headers. Puppeteer emits page network events by default. Use the simple request listener for logging or inspection.
Interception is for controlling requests—for example, changing headers for selected requests, fulfilling a request yourself, or aborting it. Once interception is enabled, every intercepted request stalls until a handler continues it, responds to it, or aborts it. A logging-only interception handler that forgets to resolve requests can prevent page activity from completing.
Rank #4
await page.setRequestInterception(true);
page.on('request', request => {
console.log(request.headers());
request.continue();
});
When multiple handlers or packages may resolve a request, check request.isInterceptResolutionHandled() before calling continue(), abort(), or respond(). If your handler awaits something before acting, check again afterward: another handler may have resolved the request in the meantime. Duplicate resolution can raise an exception. See the request interception guide.
Add headers to requests
Use a page-wide header when it applies everywhere
To add a common header to every request initiated by one page, call page.setExtraHTTPHeaders() before navigation:
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Best Value
- Used Book in Good Condition
await page.setExtraHTTPHeaders({
'x-client-tag': 'example',
});
page.on('request', request => {
console.log(request.headers()['x-client-tag']);
});
await page.goto('https://example.com');
The method accepts a string-to-string record and returns a promise. Header names are lowercased, and Puppeteer does not guarantee the order in which headers are sent. Consult the Page.setExtraHTTPHeaders() reference.
Use interception for request-specific changes
For different values on selected requests, use interception and pass header overrides to request.continue(). This gives per-request control, but also means every intercepted request must be resolved. Prefer the page-wide method when the same extra header belongs on all requests.
Troubleshooting
- A header looks missing: confirm the listener is on the
requestevent and inspect the lowercase property key, such asheaders['content-type']. - You enabled interception just to log: disable it and use the ordinary request listener. If interception is needed for another reason, ensure every request path continues, responds, or aborts.
- The page hangs after enabling interception: a request may be left unresolved, or multiple handlers may be trying to resolve it. Resolve each request and use
isInterceptResolutionHandled()where handlers can overlap. - You meant server response metadata: inspect the
responseevent rather than outgoing request headers. - A 404 or 503 appears as finished rather than failed: that is expected for an HTTP error status; Puppeteer distinguishes an HTTP response from a transport-level request failure.
Or skip the browser setup
If your goal is to capture a rendered page rather than inspect Puppeteer’s outgoing headers, ScreenshotNeo offers a one-request screenshot API. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with response headers indicating the page verdict and billing status. Its MCP server provides screenshot, page-info, and PDF-capture tools for AI agents. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Sign up for 1,000 free screenshots a month, with no card required.
Frequently Asked Questions
Which Puppeteer version is this API guidance for?
The cited API references identify themselves as Puppeteer 25.12.0; check the live documentation if using a substantially newer version.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




