test1052 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP PUT
  6. followlocation
  7. </keywords>
  8. </info>
  9. # Server-side
  10. <reply>
  11. <data>
  12. HTTP/1.0 301 Redirect swsclose
  13. Date: Thu, 29 Jul 2008 14:49:00 GMT
  14. Server: test-server/fake
  15. Location: data/%TESTNUMBER0002.txt?coolsite=yes
  16. Content-Length: 0
  17. Connection: close
  18. </data>
  19. <data2>
  20. HTTP/1.0 200 Followed here fine swsclose
  21. Date: Thu, 29 Jul 2008 14:49:00 GMT
  22. Server: test-server/fake
  23. Content-Length: 51
  24. If this is received, the location following worked
  25. </data2>
  26. <datacheck>
  27. HTTP/1.0 301 Redirect swsclose
  28. Date: Thu, 29 Jul 2008 14:49:00 GMT
  29. Server: test-server/fake
  30. Location: data/%TESTNUMBER0002.txt?coolsite=yes
  31. Content-Length: 0
  32. Connection: close
  33. HTTP/1.0 200 Followed here fine swsclose
  34. Date: Thu, 29 Jul 2008 14:49:00 GMT
  35. Server: test-server/fake
  36. Content-Length: 51
  37. If this is received, the location following worked
  38. </datacheck>
  39. </reply>
  40. # Client-side
  41. <client>
  42. <server>
  43. http
  44. </server>
  45. <name>
  46. HTTP 1.0 PUT with Location: following
  47. </name>
  48. <command>
  49. http://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -0 -L -T %LOGDIR/test%TESTNUMBER.txt
  50. </command>
  51. <file name="%LOGDIR/test%TESTNUMBER.txt">
  52. Weird
  53. file
  54. to
  55. upload
  56. for
  57. testing
  58. the
  59. PUT
  60. feature
  61. </file>
  62. </client>
  63. # Verify data after the test has been "shot"
  64. <verify>
  65. # The primary reason libcurl sends the data part twice in this test is that
  66. # the test HTTP server is blocking until it has read the entire request,
  67. # including the full request-body before it responds. So in this test the
  68. # server says 301 and 200 _after_ the entire PUT body has been sent.
  69. <protocol>
  70. PUT /want/%TESTNUMBER HTTP/1.0
  71. Host: %HOSTIP:%HTTPPORT
  72. User-Agent: curl/%VERSION
  73. Accept: */*
  74. Content-Length: 78
  75. Weird
  76. file
  77. to
  78. upload
  79. for
  80. testing
  81. the
  82. PUT
  83. feature
  84. PUT /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.0
  85. Host: %HOSTIP:%HTTPPORT
  86. User-Agent: curl/%VERSION
  87. Accept: */*
  88. Content-Length: 78
  89. Weird
  90. file
  91. to
  92. upload
  93. for
  94. testing
  95. the
  96. PUT
  97. feature
  98. </protocol>
  99. </verify>
  100. </testcase>