aboutsummaryrefslogtreecommitdiff
path: root/docs/cmdline-opts/header.d
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-11-15 23:44:58 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-11-16 10:42:51 +0100
commit41b1f649bf63e3663fcf3d4a678fef37688e32b7 (patch)
tree4fe54a49307d30025a67a5c83807d857f4bcbeba /docs/cmdline-opts/header.d
parent81e61cda396da7eefb15dcf20b9e8be7ada37283 (diff)
cmdline-docs: more options converted over
Diffstat (limited to 'docs/cmdline-opts/header.d')
-rw-r--r--docs/cmdline-opts/header.d39
1 files changed, 39 insertions, 0 deletions
diff --git a/docs/cmdline-opts/header.d b/docs/cmdline-opts/header.d
new file mode 100644
index 000000000..762334fe4
--- /dev/null
+++ b/docs/cmdline-opts/header.d
@@ -0,0 +1,39 @@
+Long: header
+Short: H
+Arg: <header>
+Help: Pass custom header LINE to server
+Protocols: HTTP
+---
+
+Extra header to include in the request when sending HTTP to a server. You may
+specify any number of extra headers. Note that if you should add a custom
+header that has the same name as one of the internal ones curl would use, your
+externally set header will be used instead of the internal one. This allows
+you to make even trickier stuff than curl would normally do. You should not
+replace internally set headers without knowing perfectly well what you're
+doing. Remove an internal header by giving a replacement without content on
+the right side of the colon, as in: -H \&"Host:". If you send the custom
+header with no-value then its header must be terminated with a semicolon, such
+as \-H \&"X-Custom-Header;" to send "X-Custom-Header:".
+
+curl will make sure that each header you add/replace is sent with the proper
+end-of-line marker, you should thus \fBnot\fP add that as a part of the header
+content: do not add newlines or carriage returns, they will only mess things up
+for you.
+
+See also the --user-agent and --referer options.
+
+Starting in 7.37.0, you need --proxy-header to send custom headers intended
+for a proxy.
+
+Example:
+
+ curl -H "X-First-Name: Joe" http://example.com/
+
+\fBWARNING\fP: headers set with this option will be set in all requests - even
+after redirects are followed, like when told with \fB-L, --location\fP. This
+can lead to the header being sent to other hosts than the original host, so
+sensitive headers should be used with caution combined with following
+redirects.
+
+This option can be used multiple times to add/replace/remove multiple headers.