How to decode a Zip file from a REST GET response
My application has to call an external REST service with Basic Authentication in order to retrieve and download a zip file (byte array) containing a set of files. The response is a simple byte array, not a json. The goal is to provide to the user a button to download that specific file. Since the service is available only on client specific network and only Pega has the access, first the zip file has to be downloaded in Pega and then to be made available to the final user.
I created a simple REST connector and mapped the response on a property of Text Type giving me the byte array as raw string. When I call the connector from a data page the response is displayed as it's shown in the attachment. If I tried to map the response on a Java Object of class java.io.ByteArrayOutputStream but I don’t receive anything in this case.
- What is the best way to map the response?
- How the response can be manipulated/decoded in Pega and make it available when the user click on a the button?
Keep up to date on this post and subscribe to comments
- Can we zip the Json file in response of a REST service and send it accross to the connecting application?
- Rest Response attachment stream for large files of size 500 MB gives java heap space error, can we choose the location to write file instead of stream to a property in response, similar to OOTB CMIS GetContentStream
- How to download a file(binary stream) received from external system REST Service response in Pega application
- How to avoid pxobjclass filed from REST API service response in Pega 7.1.7
- How send pdf file as Part of REST Service Response