From 67cf134660264b643d317c601242e048d81ac40f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Jun 2024 10:13:52 +0200 Subject: [PATCH 1/3] compression: moved around - moved it from "downloads" to "transfer control" - made that section generic about compression and link to the HTTP one - create a new HTTP compression page under custom HTTP --- SUMMARY.md | 3 ++- http/modify/README.md | 1 + .../downloads => http/modify}/compression.md | 12 ++++++------ usingcurl/downloads/README.md | 1 - usingcurl/transfers/README.md | 1 + usingcurl/transfers/compression.md | 19 +++++++++++++++++++ 6 files changed, 29 insertions(+), 8 deletions(-) rename {usingcurl/downloads => http/modify}/compression.md (85%) create mode 100644 usingcurl/transfers/compression.md diff --git a/SUMMARY.md b/SUMMARY.md index ca11932fa6..6d6e7cd980 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -87,7 +87,6 @@ * [Download to a file named by the URL](usingcurl/downloads/url-named.md) * [Use the target filename from the server](usingcurl/downloads/content-disp.md) * [HTML and charsets](usingcurl/downloads/charsets.md) - * [Compression](usingcurl/downloads/compression.md) * [Shell redirects](usingcurl/downloads/redirects.md) * [Multiple downloads](usingcurl/downloads/multiple.md) * [My browser shows something else](usingcurl/downloads/browsers.md) @@ -101,6 +100,7 @@ * [Stop slow transfers](usingcurl/transfers/tooslow.md) * [Rate limiting](usingcurl/transfers/rate-limiting.md) * [Request rate limiting](usingcurl/transfers/request-rate.md) + * [Compression](usingcurl/transfers/compression.md) * [Connections](usingcurl/connections/README.md) * [Name resolve tricks](usingcurl/connections/name.md) * [Connection timeout](usingcurl/connections/timeout.md) @@ -173,6 +173,7 @@ * [User-agent](http/modify/user-agent.md) * [Ranges](http/modify/ranges.md) * [Conditionals](http/modify/conditionals.md) + * [Compression](http/modify/compression.md) * [HTTP PUT](http/put.md) * [Cookies](http/cookies/README.md) * [Cookie engine](http/cookies/engine.md) diff --git a/http/modify/README.md b/http/modify/README.md index d794e679d6..7112aba2c7 100644 --- a/http/modify/README.md +++ b/http/modify/README.md @@ -12,6 +12,7 @@ this chapter details how you can customize those. * [User-agent](user-agent.md) * [Ranges](ranges.md) * [Conditionals](conditionals.md) +* [Compression](compression.md) Of course, changing the [HTTP version](../versions/) is another way to alter the request. diff --git a/usingcurl/downloads/compression.md b/http/modify/compression.md similarity index 85% rename from usingcurl/downloads/compression.md rename to http/modify/compression.md index f965e83490..2f9b6ba3b1 100644 --- a/usingcurl/downloads/compression.md +++ b/http/modify/compression.md @@ -1,7 +1,7 @@ # Compression -curl allows you to ask HTTP and HTTPS servers to provide compressed versions -of the data and then perform automatic decompression of it on arrival. In +curl supports asking HTTP and HTTPS servers to provide compressed versions of +the data and then perform automatic decompression of it on arrival. In situations where bandwidth is more limited than CPU this helps you receive more data in a shorter amount of time. @@ -34,14 +34,14 @@ generally safer to just pick one. For SCP and SFTP transfers, there is `--compressed-ssh`. It compresses all traffic in either direction. -## HTTP headers +### HTTP headers HTTP/1.x headers cannot be compressed. HTTP/2 and HTTP/3 headers on the other hands are always compressed and cannot be sent uncompressed. However, as a convenience to users, curl always shows the headers uncompressed in a style similar to how they look for HTTP/1.x to make the output and look consistent. -## Uploads +### HTTP uploads -For HTTP there is no standard way to do compression. The above mentioned HTTP -compression methods only work for downloads. +For HTTP uploads with POST or PUT there is no standard way to do compression. +The above mentioned HTTP compression methods only work for downloads. diff --git a/usingcurl/downloads/README.md b/usingcurl/downloads/README.md index d25c1b0e3a..19e1e812af 100644 --- a/usingcurl/downloads/README.md +++ b/usingcurl/downloads/README.md @@ -12,7 +12,6 @@ specific data pointed to by a URL onto your machine. * [Download to a file named by the URL](url-named.md) * [Use the target filename from the server](content-disp.md) * [HTML and charsets](charsets.md) -* [Compression](compression.md) * [Shell redirects](redirects.md) * [Multiple downloads](multiple.md) * [My browser shows something else](browsers.md) diff --git a/usingcurl/transfers/README.md b/usingcurl/transfers/README.md index 09029fff61..082d3ed330 100644 --- a/usingcurl/transfers/README.md +++ b/usingcurl/transfers/README.md @@ -7,3 +7,4 @@ multiple transfers. * [Stop slow transfers](tooslow.md) * [Rate limiting](rate-limiting.md) * [Request rate limiting](request-rate.md) + * [Compression](compression.md) diff --git a/usingcurl/transfers/compression.md b/usingcurl/transfers/compression.md new file mode 100644 index 0000000000..f6469f6b3b --- /dev/null +++ b/usingcurl/transfers/compression.md @@ -0,0 +1,19 @@ +# Compression + +Automatic compression of data before it gets sent can help getting the data to +the other end faster due to the reduced bandwidth needed. + +curl offers automatic compression and decompression for SFTP, SCP and HTTP(S). +With HTTP(S) it is only possible to do it for downloads, while SFTP and SCP +offer it for both directions. + +## For HTTP + +See [HTTP compression](../../http/modify/compression.md) for the details. + +## For SFTP/SCP + +Provide the `--compressed-ssh` option on the command line and the transfer +will automatically and transparently use compression if it can. Like: + + curl -O --compressed-ssh sftp://example.com/bigfile From 726116a25ef6e17bc4fae7ecaf0d07c474a642af Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Jun 2024 10:15:07 +0200 Subject: [PATCH 2/3] bookindex: regen after moving files around --- bookindex.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bookindex.md b/bookindex.md index 757114366a..686bbf2062 100644 --- a/bookindex.md +++ b/bookindex.md @@ -29,15 +29,15 @@ - Chrome: [Copy as curl](cmdline/copyas.md#copy-as-curl), [SSLKEYLOGFILE](usingcurl/tls/sslkeylogfile.md#sslkeylogfile) - clone: [Building libcurl on MSYS2](install/windows/win-msys2.md#building-libcurl-on-msys2), [git](source/contributing.md#git), [Website](source/web.md#website), [build boringssl](build/boringssl.md#build-boringssl) - code of conduct: [Trust](project/trust.md#trust), [Code of Conduct](project/coc.md#code-of-conduct) - - --compressed: [Compression](usingcurl/downloads/compression.md#compression), [Gzipped transfers](http/response.md#gzipped-transfers) - - --compressed-ssh: [Compression](usingcurl/downloads/compression.md#compression) + - --compressed: [Gzipped transfers](http/response.md#gzipped-transfers), [Compression](http/modify/compression.md#compression) + - --compressed-ssh: [For SFTP/SCP](usingcurl/transfers/compression.md#for-sftp-slash-scp), [Compression](http/modify/compression.md#compression) - configure: [root](source/layout.md#root), [Handling build options](source/options.md#handling-build-options), [Platform dependent code](source/style.md#platform-dependent-code), [Autotools](build/autotools.md#autotools), [`rpath`](build/separate.md#rpath), [configure](build/tls.md#configure), [set up the build tree to get detected by curl's configure](build/boringssl.md#set-up-the-build-tree-to-get-detected-by-curls-configure), [Ifdefs](internals/windows-vs-unix.md#ifdefs), [Memory debugging](internals/memory-debugging.md#memory-debugging), [Debug builds](internals/tests/debug.md#debug-builds) - --connect-timeout: [Connection timeout](usingcurl/connections/timeout.md#connection-timeout), [Never spend more than this to connect](usingcurl/timeouts.md#never-spend-more-than-this-to-connect) - --connect-to: [Provide a replacement name](usingcurl/connections/name.md#provide-a-replacement-name) - connection cache: [Persistent connections](cmdline/persist.md#persistent-connections), [Available --write-out variables](usingcurl/verbose/writeout.md#available---write-out-variables), [Connection cache](libcurl/caches.md#connection-cache), [All options](transfers/options/all.md#all-options), [Connection reuse](transfers/conn/reuse.md#connection-reuse), [Multi handle](helpers/sharing.md#multi-handle), [connection cache](internals/caches.md#connection-cache), [connectdata](internals/structs.md#connectdata) - connection pool: [Connection reuse](cmdline/urls/connreuse.md#connection-reuse), [Persistent connections](cmdline/persist.md#persistent-connections), [Connection cache](libcurl/caches.md#connection-cache), [pool size](libcurl/performance.md#pool-size), [Connection reuse](transfers/conn/reuse.md#connection-reuse), [connection cache](internals/caches.md#connection-cache) - Connection reuse: [Connection reuse](cmdline/urls/connreuse.md#connection-reuse), [Connection cache](libcurl/caches.md#connection-cache), [threads](libcurl/performance.md#threads), [Connection reuse](transfers/conn/reuse.md#connection-reuse) - - content-encoding: [Compression](usingcurl/downloads/compression.md#compression), [Transfer encoding](http/response.md#transfer-encoding), [About content encodings](internals/content-encoding.md#about-content-encodings) + - content-encoding: [Transfer encoding](http/response.md#transfer-encoding), [Compression](http/modify/compression.md#compression), [About content encodings](internals/content-encoding.md#about-content-encodings) - contribute: [Code of Conduct](project/coc.md#code-of-conduct), [Contributing](source/contributing.md#contributing), [Introduction](README.md#introduction) - Contributing: [docs](source/layout.md#docs), [Contributing](source/contributing.md#contributing) - Cookie engine: [Cookie engine](http/cookies/engine.md#cookie-engine), [Writing cookies to file](http/cookies/writing.md#writing-cookies-to-file), [Cookie engine](libcurl-http/cookies.md#cookie-engine) @@ -242,8 +242,8 @@ - HTTP redirects: [Short options](cmdline/options.md#short-options), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [Tell curl to follow redirects](http/redirects.md#tell-curl-to-follow-redirects), [Submit a login form over HTTP](examples/login.md#submit-a-login-form-over-http) - HTTP Strict Transport Security: [HSTS](http/https/hsts.md#hsts), [HSTS](transfers/callbacks/hsts.md#hsts), [HSTS](internals/caches.md#hsts) - HTTP/1.1: [HTTP](protocols/curl.md#http), [HTTP basics](protocols/http.md#http-basics), [Trace options](usingcurl/verbose/trace.md#trace-options), [HTTP/2](usingcurl/proxies/https.md#http-slash-2), [Debugging with TELNET](usingcurl/telnet.md#debugging-with-telnet), [HTTP/2](http/versions/http2.md#http-slash-2), [Caveats](http/post/chunked.md#caveats), [The HTTP this generates](http/post/multipart.md#the-http-this-generates), [GET or POST?](http/redirects.md#get-or-post), [Request method](http/modify/method.md#request-method), [Request target](http/modify/target.md#request-target), [Customize HTTP request headers](libcurl-http/requests.md#customize-http-request-headers), [Versions](libcurl-http/versions.md#versions), [About content encodings](internals/content-encoding.md#about-content-encodings) - - HTTP/2: [HTTP](protocols/curl.md#http), [docs](source/layout.md#docs), [nghttp2](build/deps.md#nghttp2), [Line 4: Features](cmdline/curlver.md#line-4-features), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [More data](usingcurl/verbose/trace.md#more-data), [HTTP headers](usingcurl/downloads/compression.md#http-headers), [HTTP/2](usingcurl/proxies/https.md#http-slash-2), [HTTP/2](http/versions/http2.md#http-slash-2), [HTTP/3](http/versions/http3.md#http-slash-3), [HTTP/2 and later](http/post/expect100.md#http-slash-2-and-later), [GET or POST?](http/redirects.md#get-or-post), [HTTP/3](http/https/altsvc.md#http-slash-3), [Trace more](libcurl/verbose.md#trace-more), [When connections are not reused as you want](transfers/conn/reuse.md#when-connections-are-not-reused-as-you-want), [QUIC and HTTP/2](transfers/conn/keepalive.md#quic-and-http-slash-2), [DNS over HTTPS](transfers/conn/names.md#dns-over-https), [HTTPS proxy](transfers/conn/proxies.md#https-proxy), [Versions](libcurl-http/versions.md#versions), [Expect: headers](libcurl-http/upload.md#expect-headers), [Multiplexing](libcurl-http/multiplexing.md#multiplexing), [HTTP/3](libcurl-http/alt-svc.md#http-slash-3), [Different backends](internals/backends.md#different-backends), [Curl_easy](internals/structs.md#curl_easy), [Variables](internals/tests/file-format.md#variables) - - HTTP/3: [HTTP](protocols/curl.md#http), [Select HTTP/3 backend](build/autotools.md#select-http-slash-3-backend), [QUIC and HTTP/3](build/deps.md#quic-and-http-slash-3), [TCP vs UDP](cmdline/urls/port.md#tcp-vs-udp), [Line 4: Features](cmdline/curlver.md#line-4-features), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [More data](usingcurl/verbose/trace.md#more-data), [HTTP headers](usingcurl/downloads/compression.md#http-headers), [HTTP/3](http/versions/http3.md#http-slash-3), [HTTP/3](http/https/altsvc.md#http-slash-3), [Which libcurl version runs](libcurl/api.md#which-libcurl-version-runs), [Trace more](libcurl/verbose.md#trace-more), [HTTP/3](transfers/conn/how.md#http-slash-3), [When connections are not reused as you want](transfers/conn/reuse.md#when-connections-are-not-reused-as-you-want), [Versions](libcurl-http/versions.md#versions), [Expect: headers](libcurl-http/upload.md#expect-headers), [Multiplexing](libcurl-http/multiplexing.md#multiplexing), [HTTP/3](libcurl-http/alt-svc.md#http-slash-3), [Different backends](internals/backends.md#different-backends) + - HTTP/2: [HTTP](protocols/curl.md#http), [docs](source/layout.md#docs), [nghttp2](build/deps.md#nghttp2), [Line 4: Features](cmdline/curlver.md#line-4-features), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [More data](usingcurl/verbose/trace.md#more-data), [HTTP/2](usingcurl/proxies/https.md#http-slash-2), [HTTP/2](http/versions/http2.md#http-slash-2), [HTTP/3](http/versions/http3.md#http-slash-3), [HTTP/2 and later](http/post/expect100.md#http-slash-2-and-later), [GET or POST?](http/redirects.md#get-or-post), [HTTP headers](http/modify/compression.md#http-headers), [HTTP/3](http/https/altsvc.md#http-slash-3), [Trace more](libcurl/verbose.md#trace-more), [When connections are not reused as you want](transfers/conn/reuse.md#when-connections-are-not-reused-as-you-want), [QUIC and HTTP/2](transfers/conn/keepalive.md#quic-and-http-slash-2), [DNS over HTTPS](transfers/conn/names.md#dns-over-https), [HTTPS proxy](transfers/conn/proxies.md#https-proxy), [Versions](libcurl-http/versions.md#versions), [Expect: headers](libcurl-http/upload.md#expect-headers), [Multiplexing](libcurl-http/multiplexing.md#multiplexing), [HTTP/3](libcurl-http/alt-svc.md#http-slash-3), [Different backends](internals/backends.md#different-backends), [Curl_easy](internals/structs.md#curl_easy), [Variables](internals/tests/file-format.md#variables) + - HTTP/3: [HTTP](protocols/curl.md#http), [Select HTTP/3 backend](build/autotools.md#select-http-slash-3-backend), [QUIC and HTTP/3](build/deps.md#quic-and-http-slash-3), [TCP vs UDP](cmdline/urls/port.md#tcp-vs-udp), [Line 4: Features](cmdline/curlver.md#line-4-features), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [More data](usingcurl/verbose/trace.md#more-data), [HTTP/3](http/versions/http3.md#http-slash-3), [HTTP headers](http/modify/compression.md#http-headers), [HTTP/3](http/https/altsvc.md#http-slash-3), [Which libcurl version runs](libcurl/api.md#which-libcurl-version-runs), [Trace more](libcurl/verbose.md#trace-more), [HTTP/3](transfers/conn/how.md#http-slash-3), [When connections are not reused as you want](transfers/conn/reuse.md#when-connections-are-not-reused-as-you-want), [Versions](libcurl-http/versions.md#versions), [Expect: headers](libcurl-http/upload.md#expect-headers), [Multiplexing](libcurl-http/multiplexing.md#multiplexing), [HTTP/3](libcurl-http/alt-svc.md#http-slash-3), [Different backends](internals/backends.md#different-backends) - HTTP/3 backend: [Select HTTP/3 backend](build/autotools.md#select-http-slash-3-backend) - --http0.9: [HTTP/0.9](http/versions/http09.md#http-slash-0-dot-9) - --http2: [HTTP/2](http/versions/http2.md#http-slash-2) @@ -321,7 +321,7 @@ ## O - - -O: [Many options and URLs](cmdline/urls/options.md#many-options-and-urls), [Numerical ranges](cmdline/globbing.md#numerical-ranges), [Download to a file named by the URL](usingcurl/downloads/url-named.md#download-to-a-file-named-by-the-url), [Use the target filename from the server](usingcurl/downloads/content-disp.md#use-the-target-filename-from-the-server), [Shell redirects](usingcurl/downloads/redirects.md#shell-redirects), [Multiple downloads](usingcurl/downloads/multiple.md#multiple-downloads), [Resuming and ranges](usingcurl/downloads/resume.md#resuming-and-ranges), [Request rate limiting](usingcurl/transfers/request-rate.md#request-rate-limiting), [Authentication](usingcurl/scpsftp.md#authentication), [Download](usingcurl/tftp.md#download), [Check by modification date](http/modify/conditionals.md#check-by-modification-date) + - -O: [Many options and URLs](cmdline/urls/options.md#many-options-and-urls), [Numerical ranges](cmdline/globbing.md#numerical-ranges), [Download to a file named by the URL](usingcurl/downloads/url-named.md#download-to-a-file-named-by-the-url), [Use the target filename from the server](usingcurl/downloads/content-disp.md#use-the-target-filename-from-the-server), [Shell redirects](usingcurl/downloads/redirects.md#shell-redirects), [Multiple downloads](usingcurl/downloads/multiple.md#multiple-downloads), [Resuming and ranges](usingcurl/downloads/resume.md#resuming-and-ranges), [Request rate limiting](usingcurl/transfers/request-rate.md#request-rate-limiting), [For SFTP/SCP](usingcurl/transfers/compression.md#for-sftp-slash-scp), [Authentication](usingcurl/scpsftp.md#authentication), [Download](usingcurl/tftp.md#download), [Check by modification date](http/modify/conditionals.md#check-by-modification-date) - openldap: [openldap](build/deps.md#openldap) - OpenSSL: [Get curl and libcurl on MSYS2](install/windows/win-msys2.md#get-curl-and-libcurl-on-msys2), [lib/vtls](source/layout.md#lib-slash-vtls), [Select TLS backend](build/autotools.md#select-tls-backend), [TLS libraries](build/tls.md#tls-libraries), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [Native CA stores](usingcurl/tls/verify.md#native-ca-stores), [OCSP stapling](usingcurl/tls/stapling.md#ocsp-stapling), [Restrictions](usingcurl/tls/sslkeylogfile.md#restrictions), [CA cert cache](libcurl/caches.md#ca-cert-cache), [All options](transfers/options/all.md#all-options), [SSL context](transfers/callbacks/sslcontext.md#ssl-context), [Available information](transfers/getinfo.md#available-information), [``](internals/tests/file-format.md#sect--less-than-features-greater-than) - --output-dir: [Store in another directory](usingcurl/downloads/url-named.md#store-in-another-directory) @@ -410,9 +410,9 @@ - Safari: [Copy as curl](cmdline/copyas.md#copy-as-curl) - Schannel: [TLS libraries](build/tls.md#tls-libraries), [Native CA stores](usingcurl/tls/verify.md#native-ca-stores), [CA cert cache](libcurl/caches.md#ca-cert-cache), [``](internals/tests/file-format.md#sect--less-than-features-greater-than) - Scheme: [Connect to port numbers](protocols/network.md#connect-to-port-numbers), [FILE](protocols/curl.md#file), [Naming](source/style.md#naming), [librtmp](build/deps.md#librtmp), [Scheme](cmdline/urls/scheme.md#scheme), [Name and password](cmdline/urls/auth.md#name-and-password), [TCP vs UDP](cmdline/urls/port.md#tcp-vs-udp), [Browsers](cmdline/urls/browsers.md#browsers), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [Available --write-out variables](usingcurl/verbose/writeout.md#available---write-out-variables), [Proxy type](usingcurl/proxies/type.md#proxy-type), [SOCKS proxy](usingcurl/proxies/socks.md#socks-proxy), [Proxy authentication](usingcurl/proxies/auth.md#proxy-authentication), [TLS for emails](usingcurl/reademail.md#tls-for-emails), [Which libcurl version](libcurl/api.md#which-libcurl-version), [Proxy types](transfers/conn/proxies.md#proxy-types), [Available information](transfers/getinfo.md#available-information), [Authentication](libcurl-http/auth.md#authentication), [`CURLU_NON_SUPPORT_SCHEME`](helpers/url/parse.md#curlu_non_support_scheme), [`CURLU_DEFAULT_PORT`](helpers/url/get.md#curlu_default_port), [URLs](helpers/ws/urls.md#urls), [Get a response into memory](examples/getinmem.md#get-a-response-into-memory), [Protocol handler](internals/handler.md#protocol-handler), [Curl_handler](internals/structs.md#curl_handler) - - SCP: [What protocols does curl support?](protocols/protocols.md#what-protocols-does-curl-support), [SCP](protocols/curl.md#scp), [SSH libraries](build/deps.md#ssh-libraries), [Supported schemes](cmdline/urls/scheme.md#supported-schemes), [Version](cmdline/curlver.md#version), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [Compression](usingcurl/downloads/compression.md#compression), [Protocols allowing upload](usingcurl/uploads.md#protocols-allowing-upload), [SCP and SFTP](usingcurl/scpsftp.md#scp-and-sftp), [All options](transfers/options/all.md#all-options), [Authentication](transfers/auth.md#authentication), [Curl_handler](internals/structs.md#curl_handler), [``](internals/tests/file-format.md#sect--less-than-server-greater-than) + - SCP: [What protocols does curl support?](protocols/protocols.md#what-protocols-does-curl-support), [SCP](protocols/curl.md#scp), [SSH libraries](build/deps.md#ssh-libraries), [Supported schemes](cmdline/urls/scheme.md#supported-schemes), [Version](cmdline/curlver.md#version), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [Protocols allowing upload](usingcurl/uploads.md#protocols-allowing-upload), [Compression](usingcurl/transfers/compression.md#compression), [SCP and SFTP](usingcurl/scpsftp.md#scp-and-sftp), [Compression](http/modify/compression.md#compression), [All options](transfers/options/all.md#all-options), [Authentication](transfers/auth.md#authentication), [Curl_handler](internals/structs.md#curl_handler), [``](internals/tests/file-format.md#sect--less-than-server-greater-than) - security: [curl-announce](project/maillists.md#curl-announce), [Commercial support](project/support.md#commercial-support), [Security](project/security.md#security), [Trust](project/trust.md#trust), [Security](protocols/network.md#security), [How much do protocols change?](protocols/protocols.md#how-much-do-protocols-change), [FTPS](protocols/curl.md#ftps), [docs](source/layout.md#docs), [Reporting vulnerabilities](source/reportvuln.md#reporting-vulnerabilities), [`http_proxy` in lower case only](usingcurl/proxies/env.md#http_proxy-in-lower-case-only), [TLS](usingcurl/tls.md#tls), [Ciphers](usingcurl/tls/ciphers.md#ciphers), [Enable TLS](usingcurl/tls/enable.md#enable-tls), [TLS versions](usingcurl/tls/versions.md#tls-versions), [HTTP/0.9](http/versions/http09.md#http-slash-0-dot-9), [HSTS](http/https/hsts.md#hsts), [Protocol version](transfers/options/tls.md#protocol-version), [All options](transfers/options/all.md#all-options), [HSTS](transfers/callbacks/hsts.md#hsts), [Authentication](transfers/auth.md#authentication), [URLs](helpers/ws/urls.md#urls), [HSTS](internals/caches.md#hsts) - - SFTP: [What protocols does curl support?](protocols/protocols.md#what-protocols-does-curl-support), [SFTP](protocols/curl.md#sftp), [SSH libraries](build/deps.md#ssh-libraries), [Supported schemes](cmdline/urls/scheme.md#supported-schemes), [Version](cmdline/curlver.md#version), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [Trace options](usingcurl/verbose/trace.md#trace-options), [Compression](usingcurl/downloads/compression.md#compression), [Protocols allowing upload](usingcurl/uploads.md#protocols-allowing-upload), [SCP and SFTP](usingcurl/scpsftp.md#scp-and-sftp), [All options](transfers/options/all.md#all-options), [Authentication](transfers/auth.md#authentication), [Curl_handler](internals/structs.md#curl_handler), [``](internals/tests/file-format.md#sect--less-than-server-greater-than), [Run a range of tests](internals/tests/run.md#run-a-range-of-tests) + - SFTP: [What protocols does curl support?](protocols/protocols.md#what-protocols-does-curl-support), [SFTP](protocols/curl.md#sftp), [SSH libraries](build/deps.md#ssh-libraries), [Supported schemes](cmdline/urls/scheme.md#supported-schemes), [Version](cmdline/curlver.md#version), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [Trace options](usingcurl/verbose/trace.md#trace-options), [Protocols allowing upload](usingcurl/uploads.md#protocols-allowing-upload), [Compression](usingcurl/transfers/compression.md#compression), [SCP and SFTP](usingcurl/scpsftp.md#scp-and-sftp), [Compression](http/modify/compression.md#compression), [All options](transfers/options/all.md#all-options), [Authentication](transfers/auth.md#authentication), [Curl_handler](internals/structs.md#curl_handler), [``](internals/tests/file-format.md#sect--less-than-server-greater-than), [Run a range of tests](internals/tests/run.md#run-a-range-of-tests) - --silent: [Progress meter](cmdline/progressmeter.md#progress-meter), [Error message](cmdline/exitcode.md#error-message) - SMTP: [What protocols does curl support?](protocols/protocols.md#what-protocols-does-curl-support), [SMTP](protocols/curl.md#smtp), [Without scheme](cmdline/urls/scheme.md#without-scheme), [Version](cmdline/curlver.md#version), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [Protocols allowing upload](usingcurl/uploads.md#protocols-allowing-upload), [Enable TLS](usingcurl/tls/enable.md#enable-tls), [Sending email](usingcurl/smtp.md#sending-email), [STARTTLS](transfers/options/tls.md#starttls), [All options](transfers/options/all.md#all-options), [`CURLU_GUESS_SCHEME`](helpers/url/parse.md#curlu_guess_scheme), [Variables](internals/tests/file-format.md#variables), [Test servers](internals/tests/servers.md#test-servers) - SMTPS: [What protocols does curl support?](protocols/protocols.md#what-protocols-does-curl-support), [SMTPS](protocols/curl.md#smtps), [TLS libraries](build/tls.md#tls-libraries), [Supported schemes](cmdline/urls/scheme.md#supported-schemes), [Version](cmdline/curlver.md#version), [Protocols allowing upload](usingcurl/uploads.md#protocols-allowing-upload), [Enable TLS](usingcurl/tls/enable.md#enable-tls) @@ -443,7 +443,7 @@ - TLS: [Security](protocols/network.md#security), [How much do protocols change?](protocols/protocols.md#how-much-do-protocols-change), [GOPHERS](protocols/curl.md#gophers), [The URL converted to a request](protocols/http.md#the-url-converted-to-a-request), [Ubuntu and Debian](install/linux.md#ubuntu-and-debian), [lib/vtls](source/layout.md#lib-slash-vtls), [Handling build options](source/options.md#handling-build-options), [Select TLS backend](build/autotools.md#select-tls-backend), [TLS libraries](build/deps.md#tls-libraries), [TLS libraries](build/tls.md#tls-libraries), [Connection reuse](cmdline/urls/connreuse.md#connection-reuse), [Line 1: curl](cmdline/curlver.md#line-1-curl), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [More data](usingcurl/verbose/trace.md#more-data), [Available --write-out variables](usingcurl/verbose/writeout.md#available---write-out-variables), [Change the Host: header](usingcurl/connections/name.md#change-the-host-header), [Never spend more than this to connect](usingcurl/timeouts.md#never-spend-more-than-this-to-connect), [MITM proxy](usingcurl/proxies/mitm.md#mitm-proxy), [TLS](usingcurl/tls.md#tls), [Ciphers](usingcurl/tls/ciphers.md#ciphers), [Enable TLS](usingcurl/tls/enable.md#enable-tls), [TLS versions](usingcurl/tls/versions.md#tls-versions), [Verifying server certificates](usingcurl/tls/verify.md#verifying-server-certificates), [Certificate pinning](usingcurl/tls/pinning.md#certificate-pinning), [OCSP stapling](usingcurl/tls/stapling.md#ocsp-stapling), [Client certificates](usingcurl/tls/clientcert.md#client-certificates), [TLS auth](usingcurl/tls/auth.md#tls-auth), [TLS backends](usingcurl/tls/backends.md#tls-backends), [SSLKEYLOGFILE](usingcurl/tls/sslkeylogfile.md#sslkeylogfile), [SCP and SFTP](usingcurl/scpsftp.md#scp-and-sftp), [TLS for emails](usingcurl/reademail.md#tls-for-emails), [Caveats](usingcurl/mqtt.md#caveats), [HTTPS only](http/versions/http3.md#https-only), [Figure out what a browser sends](http/post/browsersends.md#figure-out-what-a-browser-sends), [HTTPS](http/https.md#https), [TLS fingerprinting](http/browserlike.md#tls-fingerprinting), [FTPS](ftp/ftps.md#ftps), [Trace everything](libcurl/verbose.md#trace-everything), [Caches](libcurl/caches.md#caches), [reuse handles](libcurl/performance.md#reuse-handles), [TLS options](transfers/options/tls.md#tls-options), [All options](transfers/options/all.md#all-options), [SSL context](transfers/callbacks/sslcontext.md#ssl-context), [HTTP proxy](transfers/conn/proxies.md#http-proxy), [Authentication](transfers/auth.md#authentication), [Available information](transfers/getinfo.md#available-information), [URLs](helpers/ws/urls.md#urls), [Different backends](internals/backends.md#different-backends), [connection cache](internals/caches.md#connection-cache), [Variables](internals/tests/file-format.md#variables) - TLS backend: [Ubuntu and Debian](install/linux.md#ubuntu-and-debian), [lib/vtls](source/layout.md#lib-slash-vtls), [Select TLS backend](build/autotools.md#select-tls-backend), [Line 1: curl](cmdline/curlver.md#line-1-curl), [Available exit codes](cmdline/exitcode.md#available-exit-codes), [TLS](usingcurl/tls.md#tls), [Native CA stores](usingcurl/tls/verify.md#native-ca-stores), [Certificate pinning](usingcurl/tls/pinning.md#certificate-pinning), [OCSP stapling](usingcurl/tls/stapling.md#ocsp-stapling), [Client certificates](usingcurl/tls/clientcert.md#client-certificates), [TLS backends](usingcurl/tls/backends.md#tls-backends), [CA cert cache](libcurl/caches.md#ca-cert-cache), [SSL context](transfers/callbacks/sslcontext.md#ssl-context) - TODO: [Future](project/future.md#future), [Suggestions](source/contributing.md#suggestions) - - --tr-encoding: [Compression](usingcurl/downloads/compression.md#compression), [Transfer encoding](http/response.md#transfer-encoding) + - --tr-encoding: [Transfer encoding](http/response.md#transfer-encoding), [Compression](http/modify/compression.md#compression) - --trace: [Trace options](usingcurl/verbose/trace.md#trace-options), [``](internals/tests/file-format.md#sect--less-than-command--option-no-output-slash-no-include-slash-force-output-slash-binary-trace---timeout-secs--delay-secs--type-perl-slash-shell--greater-than) - --trace-ascii: [Trace options](usingcurl/verbose/trace.md#trace-options), [Server differences](usingcurl/downloads/browsers.md#server-differences), [``](internals/tests/file-format.md#sect--less-than-command--option-no-output-slash-no-include-slash-force-output-slash-binary-trace---timeout-secs--delay-secs--type-perl-slash-shell--greater-than) - --trace-config: [More data](usingcurl/verbose/trace.md#more-data) From 60a2f51c97f282c7aa85d642a560b38baf84092f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Jun 2024 10:18:40 +0200 Subject: [PATCH 3/3] fixup markdown header level mismatch --- http/modify/compression.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/http/modify/compression.md b/http/modify/compression.md index 2f9b6ba3b1..3b7fce8403 100644 --- a/http/modify/compression.md +++ b/http/modify/compression.md @@ -34,14 +34,17 @@ generally safer to just pick one. For SCP and SFTP transfers, there is `--compressed-ssh`. It compresses all traffic in either direction. -### HTTP headers +## HTTP headers HTTP/1.x headers cannot be compressed. HTTP/2 and HTTP/3 headers on the other hands are always compressed and cannot be sent uncompressed. However, as a convenience to users, curl always shows the headers uncompressed in a style similar to how they look for HTTP/1.x to make the output and look consistent. -### HTTP uploads +## HTTP uploads For HTTP uploads with POST or PUT there is no standard way to do compression. The above mentioned HTTP compression methods only work for downloads. + +You can of course still compress the data locally before sending it to the +server.