What means http header "CONTENT-ENCODING: deflate"
Hello!
I do some http get request. And this is its response
+----------------- general information ---------------
| oref value: 5
| class name: %Net.HttpResponse
| reference count: 3
+----------------- attribute values ------------------
| ContentBoundary = ""
| ContentInfo = ""
| ContentLength = 1220
| ContentType = "text/json"
| Data = "6@%Stream.GlobalBinary"
|Headers("ACCEPT-RANGES") = "bytes"
|Headers("CONTENT-ENCODING") = "deflate"
|Headers("CONTENT-LENGTH") = 1220
|Headers("CONTENT-TYPE") = "text/json"
| Headers("ETAG") = """4BF7C3AB"""
|Headers("LAST-MODIFIED") = "Wed, 19 Jun 2019 12:56:33 GMT"
| Headers("SERVER") = "lw-http 1.03 (32-bit)"
| HttpVersion = "HTTP/1.1"
| ReasonPhrase = "OK"
| StatusCode = 200
| StatusLine = "HTTP/1.1 200 OK"
+-----------------------------------------------------
As far as I understand, header Headers("CONTENT-ENCODING") = "deflate" means that content of the response is compressed?
If so, how I can decompress it?
Hi Ruslan,
Yes see the mozila specification: https://developer.mozilla.org/pt-BR/docs/Web/HTTP/Headers/Content-Encoding
Yes, it's compressed, you can try to use $system.Util.Decompress()
<WIDE CHAR> error occured.
I think it is because of I have 8-bit version of cache and the http response in utf-8. How to solve this?
I have also used $ZCVT(text, "I","UTF8") , but <TRANSLATE> error is occured
Is the response actually compressed?
I thought automatic decompression is happening a few layers down on the stack.