Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

235
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda