mirror of
https://github.com/curl/curl.git
synced 2024-12-09 06:30:06 +08:00
test1670: verify -w %header{}
This commit is contained in:
parent
4133a69f2d
commit
62b60ed1a0
@ -22,9 +22,10 @@ output a newline by using \\n, a carriage return with \\r and a tab space with
|
||||
The output will be written to standard output, but this can be switched to
|
||||
standard error by using %{stderr}.
|
||||
|
||||
You can also access HTTP headers of the most recent request done, with the
|
||||
help of \fB%header{name}\fP where \fBname\fP is the case insensitive name of
|
||||
the header (without trailing colon). Added in curl 7.83.0.
|
||||
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
|
||||
|
@ -209,6 +209,8 @@ test1630 test1631 test1632 test1633 test1634 \
|
||||
test1650 test1651 test1652 test1653 test1654 test1655 \
|
||||
test1660 test1661 \
|
||||
\
|
||||
test1670 \
|
||||
\
|
||||
test1680 test1681 test1682 test1683 \
|
||||
\
|
||||
test1700 test1701 test1702 test1703 \
|
||||
|
58
tests/data/test1670
Normal file
58
tests/data/test1670
Normal file
@ -0,0 +1,58 @@
|
||||
<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
|
||||
Content-Length: 6
|
||||
Connection: close
|
||||
Content-Type: text/html
|
||||
Funny-head: yesyes
|
||||
|
||||
-foo-
|
||||
</data>
|
||||
</reply>
|
||||
|
||||
#
|
||||
# Client-side
|
||||
<client>
|
||||
<server>
|
||||
http
|
||||
</server>
|
||||
<name>
|
||||
-w individual header output
|
||||
</name>
|
||||
<command option="no-output">
|
||||
http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%header{etag} %header{nope} %header{DATE}\n' -o log/%TESTNUMBER.out
|
||||
</command>
|
||||
</client>
|
||||
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<protocol>
|
||||
GET /%TESTNUMBER HTTP/1.1
|
||||
Host: %HOSTIP:%HTTPPORT
|
||||
User-Agent: curl/%VERSION
|
||||
Accept: */*
|
||||
|
||||
</protocol>
|
||||
<stdout mode="text">
|
||||
"21025-dc7-39462498" Tue, 09 Nov 2010 14:49:00 GMT
|
||||
</stdout>
|
||||
</verify>
|
||||
</testcase>
|
Loading…
Reference in New Issue
Block a user