test1671 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. -w
  7. %header
  8. </keywords>
  9. </info>
  10. #
  11. # Server-side
  12. <reply>
  13. <data nocheck="yes">
  14. HTTP/1.1 200 OK
  15. Date: Tue, 09 Nov 2010 14:49:00 GMT
  16. Server: test-server/fake
  17. Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
  18. ETag: "21025-dc7-39462498"
  19. Accept-Ranges: bytes
  20. Set-Cookie: firstcookie=want1; path=/
  21. Funny-head: yesyes
  22. Set-Cookie: 2cookie=want2; path=/
  23. Content-Type: text/html
  24. Set-Cookie: cookie3=want3; path=/
  25. Content-Length: 6
  26. Connection: close
  27. -foo-
  28. </data>
  29. </reply>
  30. #
  31. # Client-side
  32. <client>
  33. <features>
  34. headers-api
  35. </features>
  36. <server>
  37. http
  38. </server>
  39. <name>
  40. -w header JSON output
  41. </name>
  42. <command option="no-output">
  43. http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%{header_json}\n' -o log/%TESTNUMBER.out
  44. </command>
  45. </client>
  46. #
  47. # Verify data after the test has been "shot"
  48. <verify>
  49. <protocol>
  50. GET /%TESTNUMBER HTTP/1.1
  51. Host: %HOSTIP:%HTTPPORT
  52. User-Agent: curl/%VERSION
  53. Accept: */*
  54. </protocol>
  55. <stdout mode="text">
  56. {"date":["Tue, 09 Nov 2010 14:49:00 GMT"],
  57. "server":["test-server/fake"],
  58. "last-modified":["Tue, 13 Jun 2000 12:10:00 GMT"],
  59. "etag":["\"21025-dc7-39462498\""],
  60. "accept-ranges":["bytes"],
  61. "set-cookie":["firstcookie=want1; path=/","2cookie=want2; path=/","cookie3=want3; path=/"],
  62. "content-length":["6"],
  63. "connection":["close"]
  64. }
  65. </stdout>
  66. </verify>
  67. </testcase>
  68. o