Consuming Rest API : problem with response body

Hi 

I am Using "Consume Rest API" for a particular URL and giving required headers and request body.

However, I am receiving junk/encrypted response as shown in screenshot below.

The same is giving correct result when tried in Postman.

Any suggestion?


mvp_badge
MVP

That seems like compressed data. What happens if you leave the "Accept-Encoding" empty?

Tried doing that. Didn't work.

mvp_badge
MVP

Hi Rakhi,

Just something I noticed. I see a typo in the Accept header field. 

It says applications/json where it should be application/json.

Regards,

Nordin

Oh yes, it was a type. But correcting that too, didn't work, is giving me the same junk/encoded result

did you make any progress with your issue?


To me it seems like your encoding is wrong. Possibly it could be compressing, as Kilian mentioned.

first thing to do is to have a look what SOAP UI or another webservice tool returns.



Hi Rakhi,

As  the Rest API has accept encoding as "gzip deflate" the data coming from the server is in compressed format and at the client the data should be decompressed.  In the Test tab of API you are seeing the compressed data however if you get the response from Postman you can paste the response in Body tab that would generate the necessary Structures  refer the attached screen shot.

Postman does this decompression may be outsystems  Test tab currently doesn't support the decompression but the compressed API's works fine by just adding the response in Response tab.

Best Regards

Devendra Baghel


response.PNG

Hi, friend. 

I faced something like that with an API that was responsing a binary file. You need ti check wich format is that in response.

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