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

234
Views
Cypress 9.6.0 - response returned from cy.request has a body as ArrayBuffer

I'd like to access response body of request sent via cy.request inside custom command, but response's body turns out to be ArrayBuffer for some weird reason, but rest of the response is just fine. Here is code example:

Cypress.Commands.add('requestWrapped', ({ method, path, body }) => {
  const token = window.sessionStorage.getItem('x-csrf')

  cy.request({
    method,
    url: `${Cypress.env('backendUrl')}/${path}`,
    body,
    headers: {
      'X-CSRF-Token': token,
      'Access-Control-Allow-Credentials': true,
      'content-type': 'application/json; charset=utf-8',
    },
  }).then((res) => {
    console.log(res.body) // ArrayBuffer here
  })
})

And it's being called inside it block

cy.requestWrapped({
  method: 'POST',
  path: 'some/random/path',
  body: {
    name: xyz,
    id: 123-123,
  },
})

I also tried to use cy.request standalone inside the test, without any wrapper around - got same result

Any ideas what might went wrong there? Thanks in advance.

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!