Consuming Rest API : problem with response body


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?


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

Tried doing that. Didn't work.


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.



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


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.

How do i check which format is that in response, and how do you use that information to solve the issue?


have you tried to decompress the response with this component?

On the component page you can even test the webservice.

Best regards,

Great component, Rui. Unfortunately, because this can obly be applied at OnAfterResponse, the compound structure that us usually auto-created using the JSON Response format will not work because at the test stage it has not been decompressed. There should be a better way that OutSystems handles the auto generation of these structures. I have a very complex JSON structure and creating it manually is going to be very difficult and time consuming.  


Hi Robert,

Two thoughts: one, compressed REST response is very rare, and kinda useless, as HTTP(S) communication is typically already compressed. I've never seen compressed REST responses in the wild myself (and I've consumed a fair bit of them). So I can fully understand OS not supporting this out of the box. Two, if you already have the JSON of the response, you can use the "Add Structure from JSON..." command, which you can access via the context menu of the Structures folder in the Data tab:

As you said if the json structure is too complex to be handled by the OustSystems automatism and also too much to be written by hand, I suggest that you use some SOAP service tool such as SoapUi to assemble a clone of the service and there you can export the Json structure, which should be placed in OutSystem as Kilian shown.

Another way will be to use some site that converts the response into json.

Good luck in your task.

I remembered that if you use the test page of the component you have access to the answer, In OustSystems you will configure a new service (dummy) and put in the answer the same that you received in the test page of the component.

This new service will not work, but it will generate the structure for you to use in the original.

Good suggestion. I didn't know about this feature.

This is also a good suggestion. I'l try them both.


This worked for me by putting the gzip decompress action in the API OnAfterFetch, inputting the response binary, and setting the customized response text to the gzip output

Hey All, I tried to consume an endpoint as well however the copy response to body button is greyed out eventhough the response is 200 OK, why is that?

It would be better if you put this question on the forum with a new post.

Put in a screenshot as well. 

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