0 votes

Hi,

apparently, the response.body of a openUrlSecure call is empty when the success != true.
is that a feature or an anomaly?

It seems that the body is well filled when success = true;

point is the api i am requesting send me an error message in the body (checked it with postman)

Do I have a way to workaround this?

asked in Efficy/ Client side by (983 points)
The api documentation says: "success" is true when the HTTP statusCode is in the 200-2xx range but it doesn't say anything about the body. Do you have the same status code in Efficy compared to Postman?
affirmative sir!
to make it simpler to undersand :

If I send a request that return an error with postman I have a 500 statusCode and a message in the body.

Sending the same request through openUrlSecure return a 500 statusCode and an empty body.

with a success result the body is filled with postman and with openUrlSecure.

1 Answer

0 votes

Hello Louis

I can also reproduce it. If send an invalid request to a SOAP service, I get a 500 error status code back. In postman, I do see XML in the response body, but In Efficy the body is just "Internal Server Error", the actual description of the status code.

Below the "to JS" converted response object received from openUrlSecure

{
    "success": false,
    "statusCode": 500,
    "body": "Internal Server Error",
    "headers": "HTTP/1.1 500 Internal Server Error\r\nContent-Type: text/xml; charset=utf-8\r\nServer: Microsoft-IIS/8.5\r\nX-Powered-By: ASP.NET\r\nDate: Tue, 11 Dec 2018 13:48:28 GMT\r\nContent-Length: 799\r\n\r\n"
}

I will check with R&D if this is intended or not.

Edit, received feedback:

If the response HTTP status code is >= 300, and the response does contain extra status text, it is included in the body of the result, in the form. if an exception occurs during the execution of OpenUrlSecure, the body will contain info about the exception. Otherwise, the contents of the body are returned and read out based on the Content-Length header.

This explains our differences. Conclusion, it's a design decision.

answered by (6.9k points)
edited by
Ticket CFT-2018-94344 is created
by calling a rest API I can't even have the Internal server error message.
The body is simply an empty string.
Maybe it depends on the Content-Type, I don't know. Let's wait for the reply of the ticket.
thank you Kristof
Explanation appended to the original answer
Sorry but I don't get it.
my error is >= 500 i have no content in the body therefore the content length in the result tells me that there is something (since length = 97 in my case)
how is that a design decision?
Try to test with an HTTP (not SSL) end point and open Fiddler (free network package scanning app). Compare the request of Postman with Efficy's request. It's most likely that your requests are not identical, idem dito with the response.

You can't see the response length in Efficy, I assume the 97 is what you read in Postman.
1,173 questions
1,433 answers
1,726 comments
325 users