The title says it all: I'm trying to post gzipped JSON content to an IIS server using RestSharp.
I've searched and searched, but all I come up with are results that talk about handling a gzipped response: RestSharp compress request while making rest call to server
...or pages that simply claim that RestSharp supports gzip: http://www.bevanblackie.com/2012/03/restsharp-supports-gzip.html
It was really easy to compress responses from IIS by simply changing the IIS configuration. But I can't figure out how to post compressed content to the IIS web server. Ideally, RestSharp would handle this automatically and see if the server supports gzip compression and if not, send an uncompressed POST.
Set Content-Type as "application/json"
request.AddHeader("Content-Type", "application/json");
Set Content-Encoding as "gzip"
request.AddHeader("Content-Encoding", "gzip");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With