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

106
Views
How to retrieve the Request data from Post request that is triggered by Javascript

I am new to test Javascript. and the test is like this,

Load a page, then the Javascript is triggered, it fills the request payload data and then trigger the POST request with the generated payload data. My test need to validate the payload data are right. My problem is in the Chrome developer tool, I can see the POST request with Request Payload data. But I don't know how to get the Request payload data with any automation test tool or any other way.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It's pretty simple with something like Cypress.

You can view the docs how to setup Cypress: https://docs.cypress.io/guides/getting-started/installing-cypress

The test itself can be something like:

it('Should log the request body', () => {

  // start by intercepting the request
  cy.intercept('POST', '**/endpoint').as('interceptedRequest')

  // visit your url, and do some actions to trigger the request
  cy.visit('http://yoururl.com')

  // wait for your request to trigger
  cy.wait('@interceptedRequest')
    .its('request.body')
    .then((body) => {
      console.log(body)
    })
})
about 4 years ago · Juan Pablo Isaza Report
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!