test1076 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP POST
  6. followlocation
  7. </keywords>
  8. </info>
  9. #
  10. # Server-side
  11. <reply>
  12. <data>
  13. HTTP/1.1 302 OK swsclose
  14. Location: moo.html&testcase=/10760002
  15. Date: Thu, 09 Nov 2010 14:49:00 GMT
  16. Connection: close
  17. </data>
  18. <data2>
  19. HTTP/1.1 200 OK swsclose
  20. Location: this should be ignored
  21. Date: Thu, 09 Nov 2010 14:49:00 GMT
  22. Connection: close
  23. body
  24. </data2>
  25. <datacheck>
  26. HTTP/1.1 302 OK swsclose
  27. Location: moo.html&testcase=/10760002
  28. Date: Thu, 09 Nov 2010 14:49:00 GMT
  29. Connection: close
  30. HTTP/1.1 200 OK swsclose
  31. Location: this should be ignored
  32. Date: Thu, 09 Nov 2010 14:49:00 GMT
  33. Connection: close
  34. body
  35. </datacheck>
  36. </reply>
  37. #
  38. # Client-side
  39. <client>
  40. <server>
  41. http
  42. </server>
  43. <name>
  44. HTTP POST with 302 redirect and --post302
  45. </name>
  46. <command>
  47. http://%HOSTIP:%HTTPPORT/blah/1076 -L -d "moo" --post302
  48. </command>
  49. </client>
  50. #
  51. # Verify data after the test has been "shot"
  52. <verify>
  53. <strip>
  54. ^User-Agent:.*
  55. </strip>
  56. <protocol nonewline="yes">
  57. POST /blah/1076 HTTP/1.1
  58. Host: %HOSTIP:%HTTPPORT
  59. Accept: */*
  60. Content-Length: 3
  61. Content-Type: application/x-www-form-urlencoded
  62. mooPOST /blah/moo.html&testcase=/10760002 HTTP/1.1
  63. User-Agent: curl/7.10 (i686-pc-linux-gnu) libcurl/7.10 OpenSSL/0.9.6c ipv6 zlib/1.1.3
  64. Host: %HOSTIP:%HTTPPORT
  65. Accept: */*
  66. Content-Length: 3
  67. Content-Type: application/x-www-form-urlencoded
  68. moo
  69. </protocol>
  70. </verify>
  71. </testcase>