Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Call request.method() on the HTTPRequest object supplied by Puppeteer’s request event. For example, request.method() returns values such as GET or POST. You do not need request interception just to read the method.

Log the method for each request

Register the listener before navigating to a page or triggering the action that sends the request. The event callback receives an HTTPRequest object:

page.on('request', request => {
  console.log(request.method(), request.url());
});

The first value is the HTTP method; the second is the request URL. Puppeteer documents HTTPRequest.method() as the method accessor. See the HTTPRequest API.

Complete example with navigation

This example launches Chromium, attaches the listener, then navigates so the initial page requests are observed. Install Puppeteer in your project first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();

    page.on('request', request => {
      console.log(`${request.method()} ${request.url()}`);
    });

    await page.goto('https://example.com');
  } finally {
    await browser.close();
  }
})();

Check whether a request is POST

Compare the returned string with 'POST'. This listener logs only POST requests:

page.on('request', request => {
  if (request.method() === 'POST') {
    console.log('POST request:', request.url());
  }
});

Use the same comparison inside any request handler when you need to branch on the method. The method tells you the request’s HTTP verb; it does not provide the request body.

Wait for a particular request

When you need one matching request rather than a log of every request, use page.waitForRequest() with a predicate. It resolves to the matching HTTPRequest object:

const request = await page.waitForRequest(
  request => request.url().includes('/api/') && request.method() === 'POST'
);

console.log(request.method(), request.url());

Start the wait before the user action or page operation that triggers the request; otherwise, the request may occur before the wait is registered. See the Page.waitForRequest() API.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do you need request interception?

No. The request event is enough to observe the method. Interception is for changing request behavior, such as continuing, aborting, or fulfilling a request. Once interception is enabled, requests stall until they are resolved or served from the browser cache. Avoid enabling it for logging alone.

If you do need interception, make sure every intercepted request is resolved. When multiple handlers might resolve the same request, Puppeteer’s network interception guide shows checking isInterceptResolutionHandled() before acting. The Page.setRequestInterception() API describes enabling interception.

Understand request lifecycle edge cases

HTTP error status is not the same as a failed request

A response such as 404 or 503 can still be a completed HTTP transaction. Puppeteer can emit requestfinished for it. The requestfailed event indicates a failure during request execution, not merely a non-2xx status code.

Redirects can create multiple request objects

A redirect involves a finished request and a newly issued request to the redirected URL. If you are inspecting a redirect chain, examine each HTTPRequest separately rather than assuming one request object represents the entire chain.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
The SQL Programming Language: .
  • Used Book in Good Condition

Reading the body is separate

method() only reads the method. For request-body details, the current HTTPRequest API marks postData() as deprecated in favor of fetchPostData(). Check the API documentation for the Puppeteer version installed in your project; the documentation consulted here reports version 25.12.0.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

  • No request logs appear: Attach the request listener before navigation or the action that triggers the request.
  • The expected request is missed by waitForRequest(): Set up the wait before triggering the action, and verify that the URL condition and method comparison match the actual request.
  • Requests hang after enabling interception: Resolve every intercepted request by continuing, aborting, or responding to it; do not enable interception for observation alone.
  • A 404 or 503 is not reported as requestfailed: That status can be a completed HTTP transaction. Inspect the response status separately from request execution failure.
  • A redirect seems to have a different method or URL: Inspect each request object in the redirect sequence; the redirected URL is a newly issued request.

Or skip the browser setup

If your goal is a clean screenshot rather than inspecting Puppeteer’s network events, ScreenshotNeo returns a screenshot or PDF from one GET request. Its API does not expose Puppeteer request methods, so use Puppeteer above when you specifically need that information.

For example, with cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for setup and options. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for free.

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.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.