问题
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