1

When I use httpclient and the StatusCode return is 4xx

httpclient.tostring() returns

{
  type: "https://tools.ietf.org/html/rfc7231#section-6.5.1",
  title: "One or more validation errors occurred.",
  status: 400,
  traceId: "00-555971e51ee0d44a908a2b626d0f0179-4e6ae7d36f83cc42-00",
  errors: { "": ["A non-empty request body is required."] },
}

And I can't retrieve the content of the body that came with the status code 4xx, be it 404 or 412 for example

Amila Senadheera
  • 12,229
  • 15
  • 27
  • 43

1 Answers1

0

As Chona said, you could try with:

if not &httpclient.ErrCode.IsEmpty()
    &Error = '! errorCode=' + &httpclient.ErrCode.ToString().Trim() + ', errorDescr=' + &httpclient.ErrDescription + ', reasonLine=' + &httpclient.ReasonLine
    MSG(&Error)
endif