test1188 990 B

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