test44 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP FORMPOST
  6. HTTP replaced headers
  7. </keywords>
  8. </info>
  9. # Server-side
  10. <reply>
  11. <data>
  12. HTTP/1.0 200 OK swsclose
  13. Date: Thu, 09 Nov 2010 14:49:00 GMT
  14. Server: test-server/fake
  15. blablabla
  16. </data>
  17. </reply>
  18. # Client-side
  19. <client>
  20. <server>
  21. http
  22. </server>
  23. <name>
  24. HTTP RFC1867-type formposting without Expect: header
  25. </name>
  26. <command>
  27. http://%HOSTIP:%HTTPPORT/we/want/44 -F name=daniel -F tool=curl -F file=@log/test44.txt -H "Expect:"
  28. </command>
  29. # We create this file before the command is invoked!
  30. <file name="log/test44.txt">
  31. foo-
  32. This is a moo-
  33. bar
  34. </file>
  35. </client>
  36. # Verify data after the test has been "shot"
  37. <verify>
  38. <strip>
  39. ^(User-Agent:|Content-Type: multipart/form-data;|------).*
  40. </strip>
  41. <protocol>
  42. POST /we/want/44 HTTP/1.1
  43. User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  44. Host: %HOSTIP:%HTTPPORT
  45. Accept: */*
  46. Content-Length: 408
  47. Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce
  48. ------------------------------7c633d5c27ce
  49. Content-Disposition: form-data; name="name"
  50. daniel
  51. ------------------------------7c633d5c27ce
  52. Content-Disposition: form-data; name="tool"
  53. curl
  54. ------------------------------7c633d5c27ce
  55. Content-Disposition: form-data; name="file"; filename="test44.txt"
  56. Content-Type: text/plain
  57. foo-
  58. This is a moo-
  59. bar
  60. ------------------------------7c633d5c27ce--
  61. </protocol>
  62. </verify>
  63. </testcase>