Skip to content

Commit ffd0e61

Browse files
committed
CURLOPT_ACCEPT_ENCODING.3: clarified
As discussed in #785
1 parent 22aa34f commit ffd0e61

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

docs/libcurl/opts/CURLOPT_ACCEPT_ENCODING.3

+13-3
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,31 @@ Pass a char * argument specifying what encoding you'd like.
3232

3333
Sets the contents of the Accept-Encoding: header sent in a HTTP request, and
3434
enables decoding of a response when a Content-Encoding: header is received.
35-
Three encodings are supported: \fIidentity\fP, which does nothing,
35+
Three encodings are supported: \fIidentity\fP, meaning non-compressed,
3636
\fIdeflate\fP which requests the server to compress its response using the
3737
zlib algorithm, and \fIgzip\fP which requests the gzip algorithm.
3838

3939
If a zero-length string is set like "", then an Accept-Encoding: header
4040
containing all built-in supported encodings is sent.
4141

42+
Set this option to NULL to explicitly disable it, which makes libcurl not send
43+
an Accept-Encoding: header and not decompress contents automatically.
44+
4245
You can also opt to just include the Accept-Encoding: header in your request
4346
with \fICURLOPT_HTTPHEADER(3)\fP but then there will be no automatic
4447
decompressing when receiving data.
4548

4649
This is a request, not an order; the server may or may not do it. This option
4750
must be set (to any non-NULL value) or else any unsolicited encoding done by
48-
the server is ignored. See the special file lib/README.encoding for further
49-
details.
51+
the server is ignored.
52+
53+
Servers might respond with Content-Encoding even without getting a
54+
Accept-Encoding: in the request. Servers might respond with a different
55+
Content-Encoding than what was asked for in the request.
56+
57+
The Content-Length: servers send for a compressed response is supposed to be
58+
for the compressed content but sending the size for the non-compressed version
59+
of the resource is a very common mistake.
5060
.SH DEFAULT
5161
NULL
5262
.SH PROTOCOLS

0 commit comments

Comments
 (0)