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!
Oh and a copy of a screenshot of the body response!
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
Hey Daniel, I'm trying to do the same now but I keep receiving System.IO.InvalidDataException: Found invalid data while decoding (in OnAfterResponse). Have you experienced this while implementing your solution?
Is the response of your API defined as a JSON, or binary?