test163 1.3 KB

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