summaryrefslogtreecommitdiff
path: root/lib/README.encoding
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-04-11 08:49:20 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-04-11 08:49:20 +0000
commit019c4088cfcca0d2b7c5cc4f52ca5dac0c616089 (patch)
treed8fc76dfef2f94bc87d751031cf2ced6eecdab08 /lib/README.encoding
parent0b0a88b78d98935f7f63ff70a79a58bdc7bf4c52 (diff)
downloadcurl-019c4088cfcca0d2b7c5cc4f52ca5dac0c616089.tar.gz
Dan Fandrich's gzip patch applied
Diffstat (limited to 'lib/README.encoding')
-rw-r--r--lib/README.encoding45
1 files changed, 25 insertions, 20 deletions
diff --git a/lib/README.encoding b/lib/README.encoding
index ef5c8036f..5f878038e 100644
--- a/lib/README.encoding
+++ b/lib/README.encoding
@@ -5,15 +5,15 @@
HTTP/1.1 [RFC 2616] specifies that a client may request that a server encode
its response. This is usually used to compress a response using one of a set
-of commonly available compression techniques. These schemes are `deflate'
-(the zlib algorithm), `gzip' and `compress' [sec 3.5, RFC 2616]. A client
-requests that the sever perform an encoding by including an Accept-Encoding
-header in the request document. The value of the header should be one of the
-recognized tokens `deflate', ... (there's a way to register new
-schemes/tokens, see sec 3.5 of the spec). A server MAY honor the client's
-encoding request. When a response is encoded, the server includes a
-Content-Encoding header in the response. The value of the Content-Encoding
-header indicates which scheme was used to encode the data.
+of commonly available compression techniques. These schemes are `deflate' (the
+zlib algorithm), `gzip' and `compress' [sec 3.5, RFC 2616]. A client requests
+that the sever perform an encoding by including an Accept-Encoding header in
+the request document. The value of the header should be one of the recognized
+tokens `deflate', ... (there's a way to register new schemes/tokens, see sec
+3.5 of the spec). A server MAY honor the client's encoding request. When a
+response is encoded, the server includes a Content-Encoding header in the
+response. The value of the Content-Encoding header indicates which scheme was
+used to encode the data.
A client may tell a server that it can understand several different encoding
schemes. In this case the server may choose any one of those and use it to
@@ -24,11 +24,10 @@ information on the Accept-Encoding header.
* Current support for content encoding:
-I added support for the 'deflate' content encoding to both libcurl and curl.
-Both regular and chunked transfers should work although I've tested only the
-former. The library zlib is required for this feature. Places where I
-modified the source code are commented and typically include my initials and
-the date (e.g., 08/29/02 jhrg).
+Support for the 'deflate' and 'gzip' content encoding are supported by
+libcurl. Both regular and chunked transfers should work fine. The library
+zlib is required for this feature. 'deflate' support was added by James
+Gallagher, and support for the 'gzip' encoding was added by Dan Fandrich.
* The libcurl interface:
@@ -39,15 +38,21 @@ To cause libcurl to request a content encoding use:
where <string> is the intended value of the Accept-Encoding header.
Currently, libcurl only understands how to process responses that use the
-`deflate' Content-Encoding, so the only value for CURLOPT_ENCODING that will
-work (besides "identity," which does nothing) is "deflate." If a response is
-encoded using either the `gzip' or `compress' methods, libcurl will return an
-error indicating that the response could not be decoded. If <string> is null
-or empty no Accept-Encoding header is generated.
+"deflate" or "gzip" Content-Encoding, so the only values for CURLOPT_ENCODING
+that will work (besides "identity," which does nothing) are "deflate" and
+"gzip" If a response is encoded using the "compress" or methods, libcurl will
+return an error indicating that the response could not be decoded. If
+<string> is NULL or empty no Accept-Encoding header is generated.
+
+The CURLOPT_ENCODING must be set to any non-NULL value for content to be
+automatically decoded. If it is not set and the server still sends encoded
+content (despite not having been asked), the data is returned in its raw form
+and the Content-Encoding type is not checked.
* The curl interface:
Use the --compressed option with curl to cause it to ask servers to compress
-responses using deflate.
+responses using deflate.
James Gallagher <jgallagher@gso.uri.edu>
+Dan Fandrich <dan@coneharvesters.com>