2020-12-21 06:00:13 +08:00
|
|
|
<testcase>
|
|
|
|
<info>
|
|
|
|
<keywords>
|
|
|
|
HTTP
|
|
|
|
HTTP GET
|
|
|
|
--write-out
|
|
|
|
</keywords>
|
|
|
|
</info>
|
|
|
|
|
|
|
|
# Server-side
|
|
|
|
<reply>
|
2021-02-20 07:30:18 +08:00
|
|
|
<data>
|
|
|
|
HTTP/1.1 404 Not Found
|
|
|
|
Content-Length: 0
|
2020-12-21 06:00:13 +08:00
|
|
|
Connection: close
|
|
|
|
|
|
|
|
</data>
|
|
|
|
</reply>
|
|
|
|
|
|
|
|
# Client-side
|
|
|
|
<client>
|
|
|
|
<server>
|
|
|
|
http
|
|
|
|
</server>
|
2023-10-04 17:35:54 +08:00
|
|
|
<name>
|
2020-12-21 06:00:13 +08:00
|
|
|
--write-out with %{onerror} and %{urlnum} to stderr
|
2023-10-04 17:35:54 +08:00
|
|
|
</name>
|
2020-12-21 06:00:13 +08:00
|
|
|
<command>
|
2021-03-13 00:38:26 +08:00
|
|
|
-f -s -w '%{onerror}%{stderr}%{urlnum} says %{exitcode} %{errormsg}\n' http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER
|
2020-12-21 06:00:13 +08:00
|
|
|
</command>
|
|
|
|
</client>
|
|
|
|
|
|
|
|
# Verify data after the test has been "shot"
|
|
|
|
<verify>
|
|
|
|
<protocol>
|
2021-03-13 00:38:26 +08:00
|
|
|
GET /we/want/our/%TESTNUMBER HTTP/1.1
|
2020-12-21 06:00:13 +08:00
|
|
|
Host: %HOSTIP:%HTTPPORT
|
|
|
|
User-Agent: curl/%VERSION
|
|
|
|
Accept: */*
|
|
|
|
|
2021-03-13 00:38:26 +08:00
|
|
|
GET /we/want/our/%TESTNUMBER HTTP/1.1
|
2021-02-20 07:30:18 +08:00
|
|
|
Host: %HOSTIP:%HTTPPORT
|
|
|
|
User-Agent: curl/%VERSION
|
|
|
|
Accept: */*
|
|
|
|
|
2020-12-21 06:00:13 +08:00
|
|
|
</protocol>
|
|
|
|
<stderr mode="text">
|
2021-02-20 07:30:18 +08:00
|
|
|
0 says 22 The requested URL returned error: 404
|
|
|
|
1 says 22 The requested URL returned error: 404
|
2020-12-21 06:00:13 +08:00
|
|
|
</stderr>
|
2021-02-20 07:30:18 +08:00
|
|
|
# 22 is CURLE_HTTP_RETURNED_ERROR
|
|
|
|
<errorcode>
|
|
|
|
22
|
|
|
|
</errorcode>
|
2020-12-21 06:00:13 +08:00
|
|
|
</verify>
|
|
|
|
</testcase>
|