Handling Content-Encoding : gzip - OData REST API Call 
Question

Hi all,

When calling an OData REST API, Product Master (A2X) from the SAP API Hub, we receive a response with Header Field: Content-Encoding: gzip. The body of the response is unreadable because Outsystems seems unable to handle the Content-Encoding: gzip.


However, according to Outsystems Patch update 11.6.32 states:
"Up until now, to support GZip encoded responses, the programmer need to write custom code. As It’s a common practice to use encoding in REST calls, the platform now allow this easy integration without having to develop extra code (RSBO-1137)"

Is there a way to read the body properly without having to develop extra code?

This doesn't seem to happen in all api's from the SAP API Hub though.

Thanks in advance!

ODataReactLIBProductMasterA2X.oml

Oh and a copy of a screenshot of the body response!

ODataRestApiweirdResponse.PNG

I had the same problem. 

Use another tool like postman to do the request. Then copy the response and paste it on the body of your Rest Api call in Outsystems. 

Use this component https://www.outsystems.com/forge/component-overview/8684/gzip-compress-decompress in  "On After Response" to decompress the gzip (see image attached). Assign the output text to CustomizedResponse.ResponseText

It worked for me.


Regards

OnafterResponseGZIP.JPG

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