test1332 1.4 KB

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