test1332 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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=/%TESTNUMBER0002
  16. Date: Tue, 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: Tue, 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=/%TESTNUMBER0002
  29. Date: Tue, 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: Tue, 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/%TESTNUMBER -L -d "moo" --post303
  49. </command>
  50. </client>
  51. #
  52. # Verify data after the test has been "shot"
  53. <verify>
  54. <protocol nonewline="yes">
  55. POST /blah/%TESTNUMBER HTTP/1.1
  56. Host: %HOSTIP:%HTTPPORT
  57. User-Agent: curl/%VERSION
  58. Accept: */*
  59. Content-Length: 3
  60. Content-Type: application/x-www-form-urlencoded
  61. mooPOST /blah/moo.html&testcase=/%TESTNUMBER0002 HTTP/1.1
  62. Host: %HOSTIP:%HTTPPORT
  63. User-Agent: curl/%VERSION
  64. Accept: */*
  65. Content-Length: 3
  66. Content-Type: application/x-www-form-urlencoded
  67. moo
  68. </protocol>
  69. </verify>
  70. </testcase>