test645 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP POST
  6. HTTP MIME POST
  7. </keywords>
  8. </info>
  9. #
  10. # Server-side
  11. <reply>
  12. <data>
  13. HTTP/1.1 200 OK
  14. Date: Thu, 09 Nov 2010 14:49:00 GMT
  15. Server: test-server/fake swsclose
  16. Connection: close
  17. Content-Type: text/html
  18. hello
  19. </data>
  20. <datacheck>
  21. HTTP/1.1 200 OK
  22. Date: Thu, 09 Nov 2010 14:49:00 GMT
  23. Server: test-server/fake swsclose
  24. Connection: close
  25. Content-Type: text/html
  26. hello
  27. HTTP/1.1 200 OK
  28. Date: Thu, 09 Nov 2010 14:49:00 GMT
  29. Server: test-server/fake swsclose
  30. Connection: close
  31. Content-Type: text/html
  32. hello
  33. </datacheck>
  34. </reply>
  35. # Client-side
  36. <client>
  37. <server>
  38. http
  39. </server>
  40. # tool is what to use instead of 'curl'
  41. <tool>
  42. lib645
  43. </tool>
  44. <name>
  45. HTTP multi-part chunked mimepost using read callback for the file part
  46. </name>
  47. <command>
  48. http://%HOSTIP:%HTTPPORT/645
  49. </command>
  50. </client>
  51. #
  52. # Verify data after the test has been "shot"
  53. <verify>
  54. <strippart>
  55. s/^--------------------------[a-z0-9]*/------------------------------/
  56. s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/
  57. </strippart>
  58. # Note that the stripping above removes 12 bytes from every occurrence of the
  59. # boundary string and since 5 of them are in the body contents, we see
  60. # (5*12) == 60 bytes less
  61. <protocol>
  62. POST /645 HTTP/1.1
  63. Host: %HOSTIP:%HTTPPORT
  64. Accept: */*
  65. Transfer-Encoding: chunked
  66. Content-Type: multipart/form-data; boundary=----------------------------
  67. Expect: 100-continue
  68. 2ce
  69. ------------------------------
  70. Content-Disposition: form-data; name="sendfile"; filename="postit2.c"
  71. this is what we post to the silly web server
  72. ------------------------------
  73. Content-Disposition: form-data; name="callbackdata"
  74. this is what we post to the silly web server
  75. ------------------------------
  76. Content-Disposition: form-data; name="filename"
  77. postit2.c
  78. ------------------------------
  79. Content-Disposition: form-data; name="submit"
  80. send
  81. ------------------------------
  82. Content-Disposition: form-data; name="somename"; filename="somefile.txt"
  83. Content-Type: text/plain
  84. blah blah
  85. --------------------------------
  86. 0
  87. POST /645 HTTP/1.1
  88. Host: %HOSTIP:%HTTPPORT
  89. Accept: */*
  90. Transfer-Encoding: chunked
  91. Content-Type: multipart/form-data; boundary=----------------------------
  92. Expect: 100-continue
  93. 2dc
  94. ------------------------------
  95. Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"
  96. this is what we post to the silly web server
  97. ------------------------------
  98. Content-Disposition: form-data; name="callbackdata"
  99. this is what we post to the silly web server
  100. ------------------------------
  101. Content-Disposition: form-data; name="filename"
  102. postit2.c
  103. ------------------------------
  104. Content-Disposition: form-data; name="submit"
  105. send
  106. ------------------------------
  107. Content-Disposition: form-data; name="somename"; filename="somefile.txt"
  108. Content-Type: text/plain
  109. blah blah
  110. --------------------------------
  111. 0
  112. </protocol>
  113. </verify>
  114. </testcase>