test163 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <testcase>
  2. # Server-side
  3. <reply>
  4. <data>
  5. HTTP/1.1 200 OK swsclose
  6. Date: Thu, 09 Nov 2010 14:49:00 GMT
  7. Server: test-server/fake
  8. Content-Length: 10
  9. blablabla
  10. </data>
  11. </reply>
  12. # Client-side
  13. <client>
  14. <server>
  15. http
  16. </server>
  17. <name>
  18. HTTP multipart formpost with contents from a file
  19. </name>
  20. <command>
  21. http://%HOSTIP:%HTTPPORT/we/want/163 -F "name=<log/field163" -F tool=curl
  22. </command>
  23. # We create this file before the command is invoked!
  24. <file name="log/field163">
  25. contents
  26. from
  27. a
  28. file
  29. newlinens?
  30. yes please
  31. [tab][CR] too
  32. </file>
  33. </client>
  34. # Verify data after the test has been "shot"
  35. <verify>
  36. <strip>
  37. ^(User-Agent:|Content-Type: multipart/form-data;|------------).*
  38. </strip>
  39. <protocol>
  40. POST /we/want/163 HTTP/1.1
  41. User-Agent: curl/7.11.2-CVS (i686-pc-linux-gnu) libcurl/7.11.2-CVS OpenSSL/0.9.6b zlib/1.1.4 c-ares/1.0.0
  42. Host: %HOSTIP:%HTTPPORT
  43. Accept: */*
  44. Content-Length: 304
  45. Expect: 100-continue
  46. Content-Type: multipart/form-data; boundary=----------------------------c2d1767eb6ac
  47. ------------------------------c2d1767eb6ac
  48. Content-Disposition: form-data; name="name"
  49. contents
  50. from
  51. a
  52. file
  53. newlinens?
  54. yes please
  55. [tab][CR] too
  56. ------------------------------c2d1767eb6ac
  57. Content-Disposition: form-data; name="tool"
  58. curl
  59. ------------------------------c2d1767eb6ac--
  60. </protocol>
  61. </verify>
  62. </testcase>