October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

How to Get the HTTP Method of a Puppeteer Request

Use Puppeteer’s request event and call request.method() to inspect a request’s HTTP method. Learn how to filter POSTs, wait for a match, and avoid unnecessary interception.
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: page.on('request', request => console.log(request.method())). You do not need request interception just to read a method.

Log the method for each request

Register a listener before navigating to the page or triggering the action you want to inspect. The event callback receives an HTTPRequest; its method() accessor returns the HTTP method.

As an Amazon Associate I earn from qualifying purchases.

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

To check for a particular method, compare the returned string:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
page.on('request', request => {
  if (request.method() === 'POST') {
    console.log('POST request:', request.url());
  }
});

The official API documents HTTPRequest.method() with methods such as GET and POST. See the Puppeteer HTTPRequest class reference (the version shown when checked on 2026-10-03 was 25.12.0).

Wait for a request with a particular method

When you need to pause until a matching request is issued, use page.waitForRequest() with a predicate. Set up the wait before the action that sends the request so it cannot be missed.

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

await page.click('#submit');
const request = await requestPromise;
console.log(request.method(), request.url());

waitForRequest() resolves to the matching HTTPRequest. The predicate can inspect both its URL and method; consult the Page.waitForRequest() reference for the API details.

Reading a method does not require interception

The request event is for observing requests. You can read the method directly from its event object without enabling interception.

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

page.setRequestInterception(true) is for controlling requests—for example, aborting, continuing, or providing a response. Once interception is enabled, requests can stall until they are resolved, handled from cache, or otherwise completed. Use it only when you need to change or fulfill requests, and make sure each intercepted request is resolved appropriately. The setRequestInterception() reference and network interception guide describe the behavior; the guide also advises checking isInterceptResolutionHandled() before resolving when multiple handlers may run.

Distinguish HTTP status errors from failed requests

A request that receives an HTTP error status such as 404 or 503 can still complete as an HTTP transaction and emit requestfinished. Puppeteer’s requestfailed event indicates failure during request execution; it does not simply mean that the response status was non-2xx. Check the response status separately when you need to determine whether the server returned an error.

Redirects also produce distinct request objects: the original request finishes and a new request is issued to the redirected URL. Inspect the specific object whose method you need rather than treating a redirect chain as one request.

Common problems

  • No request appears in the log: Attach the listener before navigation or before clicking, submitting, or otherwise triggering the request.
  • waitForRequest() never resolves: Confirm the action actually sends a request and that the predicate matches its URL and method. Start waiting before performing the action.
  • Requests stop progressing after adding interception: Interception is not needed for observation. Disable it if you only want to log methods; if you need interception, resolve each request and account for other handlers.
  • A 404 appears to be a finished request: That is expected lifecycle behavior. Inspect the HTTP response status instead of interpreting requestfinished as a successful application response.

Method versus request body

method() answers which HTTP method was used; it does not return the request body. The HTTPRequest API marks postData() as deprecated in favor of fetchPostData() for body retrieval. Treat body inspection as a separate step and check the API documentation matching the Puppeteer version installed in your project.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is to capture a page rather than inspect its network traffic, ScreenshotNeo provides a one-call screenshot API. It does not expose Puppeteer request methods; use the Puppeteer examples above when you need that request-level information.

Best Value
The SQL Programming Language: .
  • Used Book in Good Condition
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

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

Sign up for ScreenshotNeo 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.