2

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?

Hia
  • 21
  • 1
  • I asked and answered a [duplicate of this question](http://stackoverflow.com/questions/27607506/trestclient-trestrequest-incorrectly-decodes-gzip-response/27612450#27612450). – GolezTrol Dec 23 '14 at 13:46

1 Answers1

-1

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

Kromster
  • 7,181
  • 7
  • 63
  • 111
  • This does not enough. As far as I can see in the REST source code, `TRESTClient` uses Indy's `TIdHTTP` component internally, but does not assign a gzip decompressor to the `TIdHTTP.Compressor` property, so it cannot handle `gzip` and `deflate` encoded responses automatically. – Remy Lebeau Dec 22 '14 at 18:07