test1076 1.3 KB

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