116
Views
11
Comments
Status 200 but empty response in consumed API
Application Type
Reactive

Receiving 200 status but no value in Response. Tried the OnAfterResponse and this is the result (please see image), another weird thing is when I tried it in Postman, I receive 200 status and the response is complete.
Anyone here encounter same as this issue, if you have an idea how to resolve it. 

The datatype of the response is List

2023-10-21 19-42-11
Tousif Khan
Champion
UserImage.jpg
RD.

Tried adding header AcceptEncoding: "*". Still the same.

2020-06-04 07-36-47
Ajay Dadhich

Hello RD,

Can you please share the OML for the same?

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi RD,

If the status is 200, but you don't seem to receive a response, you either have specified the wrong structures, or the API doesn't send anything. In general, please do not use OnAfterResponse to check this, but increase the log level of your API and check in Service Center what was actually sent.

In this case, the ResponseText is "[]", so the API sends an empty array, which explains why you didn't see anything.

UserImage.jpg
RD.

Tried the logging set to full, and this one is the result. I still cant see why the response is like []. 

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

You can't see it, because that's what the remote service does. Apparently, you send something that leads it to conclude it doesn't have data for you, so it sends an empty array.

I'd study the API's documentation thoroughly, and start with a very simple use case, in Postman rather than OutSystems so it's easier to fiddle with parameters.

UserImage.jpg
RD.

Weird part is that, I tried it in postman and its response is not empty.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Then compare what Postman sends with the integration logging in Service Center. It not only logs what is returned, but also exactly what you sent.

UserImage.jpg
RD.

Hello Kilian!
Checked in headers passed in postman and OS, there is a difference in 
'X-Global-Transaction-ID' . Can it be the cause?


Postman


OS

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

I would sincerily doubt that. It's an X-header, so likely ignored by the receiving party.

2023-10-27 12-06-14
Asiyah Munawwar

Hello RD.,

As per my understanding i think do check the parameters and headers which you are passing in   the API. Also check the output structure .

Hope this will help you.

Regards


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.