clever-night-39043
03/17/2023, 5:29 AMcy.request() with the following syntax:
cy.request(
{
method: method,
url: format(endpoint, option),
failOnStatusCode: false,
headers: headers,
body: normalisedRequest
})
It works when the body is an object or string, but when the body is a number, the test fails and selector playground crashes.
The error is
The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received type number (1)
TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received type number (1)
at new NodeError (node:internal/errors:372:5)
at write_ (node:_http_outgoing:742:11)
at ClientRequest.write (node:_http_outgoing:707:15)
at ee.write (<embedded>:1955:83025)
Please help. I need to use only a number as request body. Thanks