Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8047015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:58:20+00:00 2026-06-05T05:58:20+00:00

I am consuming a rest api written in java in my C# client. I

  • 0

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 I will do is construct an object and add that directly in body of RestSharp request object and mention .netserializer for it. So it will automatically serialize it and post it. All works great.

Now I need to apply LZO or GZIP compression. So that server will have less load.

I know how to implement both compression techniques. But how to implement it with RestSharp request object?

What I got to do. I am adding object to body of request. When to perform compression?

Anyhelp…

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:58:22+00:00Added an answer on June 5, 2026 at 5:58 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any real advantages of using WCF client for consuming REST api. I
I am consuming REST API's from an Azure instance. There is also ACS single
I have a problem with sending a JSON to a Server with REST API.
I'm consuming a 3rd party API (REST JSON-based). In it they require a callback
I have problem consuming a WCF REST service in my android application. The client
I created an API wrapper class library for consuming a rest API from a
I know that are a lot of posts about consuming a WCF REST through
I am consuming data from a REST Web Service via RestKit and would like
I just tried to Make a solution on VS 2010 to practice consuming REST
I am consuming Java Web Service in VB.Net and I need to forward username,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.