test1054 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 301 OK swsclose
  14. Location: moo/testcase/%TESTNUMBER0002
  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/%TESTNUMBER0002
  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/test%TESTNUMBER.txt">
  45. field=data
  46. </file>
  47. <command>
  48. http://%HOSTIP:%HTTPPORT/blah/%TESTNUMBER -L -d @log/test%TESTNUMBER.txt --post301
  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: 10
  60. Content-Type: application/x-www-form-urlencoded
  61. field=dataPOST /blah/moo/testcase/%TESTNUMBER0002 HTTP/1.1
  62. Host: %HOSTIP:%HTTPPORT
  63. User-Agent: curl/%VERSION
  64. Accept: */*
  65. Content-Length: 10
  66. Content-Type: application/x-www-form-urlencoded
  67. field=data
  68. </protocol>
  69. </verify>
  70. </testcase>