The output will be written to standard output, but this can be switched to
standard error by using %{stderr}.
-Output HTTP headers from the most recent request by using \fB%header{name}\fP
-where \fBname\fP is the case insensitive name of the header (without the
-trailing colon). The header contents are exactly as sent over the network,
-with leading and trailing whitespace trimmed. Added in curl 7.83.0.
+EXPERIMENTAL feature: Output HTTP headers from the most recent request by
+using \fB%header{name}\fP where \fBname\fP is the case insensitive name of the
+header (without the trailing colon). The header contents are exactly as sent
+over the network, with leading and trailing whitespace trimmed. Added in curl
+7.83.0.
.B NOTE:
The %-symbol is a special symbol in the win32-environment, where all
server. (Added in 7.15.4)
.TP
.B header_json
-A JSON object with all HTTP response headers from the recent transfer.
+EXPERIMENTAL feature.
+
+A JSON object with all HTTP response headers from the recent transfer. Values
+are provided as arrays, since in the case of multiple headers there can be
+multiple values.
+
+The header names are listed in order of appearance over the wire using the
+same case as was used over the network. Except for duplicated headers. They
+are grouped on the first occurance of that header, using the casing of the
+first header, and then each value is presented in the JSON array.
.TP
.B http_code
The numerical response code that was found in the last retrieved HTTP(S) or
test1650 test1651 test1652 test1653 test1654 test1655 \
test1660 test1661 \
\
-test1670 \
+test1670 test1671 \
\
test1680 test1681 test1682 test1683 \
\
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP GET
+-w
+%header
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Set-Cookie: firstcookie=want1; path=/
+Funny-head: yesyes
+Set-Cookie: 2cookie=want2; path=/
+Content-Type: text/html
+Set-Cookie: cookie3=want3; path=/
+Content-Length: 6
+Connection: close
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<server>
+http
+</server>
+<name>
+-w header JSON output
+</name>
+<command option="no-output">
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%{header_json}\n' -o log/%TESTNUMBER.out
+</command>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol>
+GET /%TESTNUMBER HTTP/1.1\r
+Host: %HOSTIP:%HTTPPORT\r
+User-Agent: curl/%VERSION\r
+Accept: */*\r
+\r
+</protocol>
+<stdout mode="text">
+{"Date":["Tue, 09 Nov 2010 14:49:00 GMT"],
+"Server":["test-server/fake"],
+"Last-Modified":["Tue, 13 Jun 2000 12:10:00 GMT"],
+"ETag":["\"21025-dc7-39462498\""],
+"Accept-Ranges":["bytes"],
+"Set-Cookie":["firstcookie=want1; path=/","2cookie=want2; path=/","cookie3=want3; path=/"],
+"Content-Length":["6"],
+"Connection":["close"]
+}
+</stdout>
+</verify>
+</testcase>
+o
\ No newline at end of file