Uniface on GitHub
Product (releases and patches)
Fixes and Updates
Hallo to everybody,
We are calling a Rest Api and the reposnce is with content encoding gzip. We cannot decode the http responce.. any ideas ?
Thanks for your reply Daniel.
Do you have to sugest any third party dll to handle the gzip. All the other thinks than you mentioned you have already handle as per your suggestions.
You are welcome.
You could simply use Gzip for Windows and spawn the command line tool gzip.exe using the OS Command signature. E.g.
activate "OSCMD".COMMANDOUT("C:\tools\gzip\bin\gzip -c -d response.txt", Content)
There are certainly other options to do this. I did not really look for a DLL that implements the uncompress of Gzip.
I hope this helps.
Thanks Daniel. Case Closed
How do you call the Rest Api? Are you using the UHTTP component?
In case you are using the UHTTP component then you need to keep in mind that the content parameter of the SEND operation can only handle string data. When the content is gzip compressed then you should use the DUMP_FILE_CONTENTS operation.
Something like this should work:
vUhttp->SEND(vUrl, "POST", "", "", vHeaders, "", vResp)
You then need to uncompress the response with an external tool that supports gzip. There currently is no functionality built into Uniface that can do this (AFAIK).
In the above sample I assume that we are dealing with a simple download (everything is downloaded in one go). If the server returns the response using chunked file transfer then you have set some additional options for DUMP_FILE_CONTENTS (see the doc).
© 2019 Uniface Privacy & Cookies | Privacy Statement | Legal