cURL / Mailing Lists / curl-library / Single Mail


Re: gzip compression of post data.

From: <>
Date: Thu, 17 Dec 2009 17:36:35 -0800

On Thu, Dec 17, 2009 at 01:58:55PM -0800, Jason Corcoran wrote:
> Hi there,
> I have a couple of issues with my curl app. At the moment, we are
> sending 10 MB of data and we want to compress this. I understand that I
> should set the Accept-Encoding to gzip, deflate but what else should I
> set? What is the standard way to compress the data? and lastly are there
> any examples out there of doing this with libCurl.

Please have a look at lib/README.encoding in the Curl source tree.
Setting Accept-Encoding by using CURLOPT_ENCODING is a polite request to
the server to send a compressed response, if it can.

If you want the client to send compressed data to the server, you'll
need to compress the data yourself and add the compressed content to the
post request. The server will have to know how to figure out that
you're sending it compressed data.

Curl has two different POST interfaces. The first is described here:

The second used curl_formadd:

List admin:
Received on 2009-12-18