Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
Sending an xhr/fetch request with puppeteer

I'm working with puppeteer and trying to send an xhr requesr after login. Using devtools network tab, I copied the request of interest using the fetch api option. I wrapped it in the page.evaluate function as below:

let x = await page.evaluate((SecureAuthToken) => {
  return fetch("/api/Search/PropertySearch", {
    headers: {
      "accept": "application/json, text/plain, */*",
      "accept-language": "en-US,en;q=0.9",
      "content-type": "application/json;charset=UTF-8",
      "sec-ch-ua":
        '" Not A;Brand";v="99", "Chromium";v="100", "Google Chrome";v="100"',
      "sec-ch-ua-mobile": "?0",
      "sec-ch-ua-platform": '"Chrome OS"',
      "sec-fetch-dest": "empty",
      "sec-fetch-mode": "cors",
      "sec-fetch-site": "same-origin",
      "secureauthtoken": SecureAuthToken,
    },
    referrerPolicy: "no-referrer",
    body: '{"Filters":[{"FieldId":9,"BundleChildren":.....}',
    method: "POST",
    mode: "cors",
    credentials: "include",
  });
},SecureAuthToken);

I'm passing in the SecureAuthToken. when I do

console.log(x)

The result is

[]

What am I doing wrong? Also is there a good way to debug this?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!