Automatically Decode GZIP In TRESTResponse?

我怕爱的太早我们不能终老 提交于 2019-12-11 03:13:08

问题


It doesn't seem possible to assign a compressor or intercept to the TRESTClient.

If I set TRESTRequest.AcceptEncoding to 'gzip, deflate' I receive a gzip encoded response from a server that supports gzip.

However, in TIdHTTP I think it would automatically decode it. In TRESTResponse.Content it is still gzip encoded and I have to decode it manually with TIdCompressorZlib.DecompressGZipStream(). Is there a way for TRESTResponse to decode it automatically?


回答1:


It's native if you set property TCustomRESTRequest.AcceptEncoding with "gzip, deflate" value



来源:https://stackoverflow.com/questions/26610376/automatically-decode-gzip-in-trestresponse

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!