]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
docs: document default `User-Agent`
authorBrendon Smith <bws@bws.bio>
Sun, 17 Nov 2024 21:38:31 +0000 (16:38 -0500)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 17 Nov 2024 23:03:10 +0000 (00:03 +0100)
curl offers a `--user-agent` option for modifying the `User-Agent`
header supplied in its requests.

The man page section for this option explains how to use the
`--user-agent` option, but does not explain which `User-Agent` curl uses
by default.

By default, curl uses curl/VERSION, such as `User-Agent: curl/8.11.0`.

Note that this appears to be different from the libcurl default (no
User-Agent header).

This commit documents the default `User-Agent` in the man page section
for the `--user-agent` option, as well as on the "Art of Scripting"
page.

The `%VERSION` placeholder will be used to insert the current version
as described in the man page generator docs.

Closes #15608

docs/TheArtOfHttpScripting.md
docs/cmdline-opts/user-agent.md

index f4efd11bb21202cd66932cf6dc1e25d474075d34..28314ea90970677f2d0dd590a0b61bf30a3ccebb 100644 (file)
@@ -456,6 +456,8 @@ SPDX-License-Identifier: curl
  it is time to set the User Agent field to fool the server into thinking you
  are one of those browsers.
 
+ By default, curl uses curl/VERSION, such as User-Agent: curl/8.11.0.
+
  To make curl look like Internet Explorer 5 on a Windows 2000 box:
 
     curl --user-agent "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" [URL]
index 29b475857ad95898c30e8525a54e3e4101b619b6..a24bd28449ad80b152a46ebb65761bac3ae0efc6 100644 (file)
@@ -25,3 +25,5 @@ be set with the --header or the --proxy-header options.
 If you give an empty argument to --user-agent (""), it removes the header
 completely from the request. If you prefer a blank header, you can set it to a
 single space (" ").
+
+By default, curl uses curl/VERSION, such as User-Agent: curl/`%VERSION`.