test163 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. Expect: 100-continue
  52. Content-Type: multipart/form-data; boundary=----------------------------c2d1767eb6ac
  53. ------------------------------c2d1767eb6ac
  54. Content-Disposition: form-data; name="name"
  55. contents
  56. from
  57. a
  58. file
  59. newlinens?
  60. yes please
  61. [tab][CR] too
  62. ------------------------------c2d1767eb6ac
  63. Content-Disposition: form-data; name="tool"
  64. curl
  65. ------------------------------c2d1767eb6ac--
  66. </protocol>
  67. </verify>
  68. </testcase>