I am consuming a rest api written in java in my C# client. I was pumping hell lot of data to server and I was using RestSharp.dll for the purpose of making rest calls. What
RestSharp supports HTTP compression since version 102.7. I'm not sure if this works only for Windows Phone or compression is supported for all platforms.
The most common algorithms are GZip and Deflate, although the actual level of compression is usually controlled by the server.
UPDATE:
I just verified using Fiddler that HTTP Compression is enabled by default in 103.1. The following code returns a page encoded using GZip:
var target = "http://msdn.microsoft.com/";
var client=new RestClient(target);
var request = new RestRequest("",Method.GET);
var response = client.Execute(request);
Console.WriteLine(response.Content);
There is no need to add the Accept-Encoding header.
Compression will only work if the server supports it. Otherwise the response will be uncompressed.
This means that the Java service will have to enable HTTP compression as well.
If the response is compressed the Content-Encoding header will be set to the compression method, eg. gzip.
To check this visually, open Fiddler and check the responce to the RestRequest. The Transformer tab of the Response pane displays the compression settings.