test1054 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 301 OK swsclose
  14. Location: moo/testcase/10540002
  15. Date: Thu, 31 Jul 2008 14:49:00 GMT
  16. Connection: close
  17. </data>
  18. <data2>
  19. HTTP/1.1 200 OK swsclose
  20. Date: Thu, 31 Jul 2008 14:49:00 GMT
  21. Connection: close
  22. body
  23. </data2>
  24. <datacheck>
  25. HTTP/1.1 301 OK swsclose
  26. Location: moo/testcase/10540002
  27. Date: Thu, 31 Jul 2008 14:49:00 GMT
  28. Connection: close
  29. HTTP/1.1 200 OK swsclose
  30. Date: Thu, 31 Jul 2008 14:49:00 GMT
  31. Connection: close
  32. body
  33. </datacheck>
  34. </reply>
  35. #
  36. # Client-side
  37. <client>
  38. <server>
  39. http
  40. </server>
  41. <name>
  42. HTTP POST from file with 301 redirect and --post301
  43. </name>
  44. <file name="log/test1054.txt">
  45. field=data
  46. </file>
  47. <command>
  48. http://%HOSTIP:%HTTPPORT/blah/1054 -L -d @log/test1054.txt --post301
  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/1054 HTTP/1.1
  59. Host: %HOSTIP:%HTTPPORT
  60. Accept: */*
  61. Content-Length: 10
  62. Content-Type: application/x-www-form-urlencoded
  63. field=dataPOST /blah/moo/testcase/10540002 HTTP/1.1
  64. Host: %HOSTIP:%HTTPPORT
  65. Accept: */*
  66. Content-Length: 10
  67. Content-Type: application/x-www-form-urlencoded
  68. field=data
  69. </protocol>
  70. </verify>
  71. </testcase>