1<testcase> 2<info> 3<keywords> 4HTTP 5HTTP GET 6--write-out 7</keywords> 8</info> 9 10# Server-side 11<reply> 12<data> 13HTTP/1.1 404 Not Found 14Content-Length: 0 15Connection: close 16 17</data> 18</reply> 19 20# Client-side 21<client> 22<server> 23http 24</server> 25 <name> 26--write-out with %{onerror} and %{urlnum} to stderr 27 </name> 28<command> 29-f -s -w '%{onerror}%{stderr}%{urlnum} says %{exitcode} %{errormsg}\n' http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER http://%HOSTIP:%HTTPPORT/we/want/our/%TESTNUMBER 30</command> 31</client> 32 33# Verify data after the test has been "shot" 34<verify> 35<protocol> 36GET /we/want/our/%TESTNUMBER HTTP/1.1 37Host: %HOSTIP:%HTTPPORT 38User-Agent: curl/%VERSION 39Accept: */* 40 41GET /we/want/our/%TESTNUMBER HTTP/1.1 42Host: %HOSTIP:%HTTPPORT 43User-Agent: curl/%VERSION 44Accept: */* 45 46</protocol> 47<stderr mode="text"> 480 says 22 The requested URL returned error: 404 491 says 22 The requested URL returned error: 404 50</stderr> 51# 22 is CURLE_HTTP_RETURNED_ERROR 52<errorcode> 5322 54</errorcode> 55</verify> 56</testcase> 57