test39 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP FORMPOST
  6. </keywords>
  7. </info>
  8. # Server-side
  9. <reply>
  10. <data>
  11. HTTP/1.1 200 OK
  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 RFC1867-type formposting with filename= and type=
  25. </name>
  26. <command>
  27. http://%HOSTIP:%HTTPPORT/we/want/39 -F name=daniel -F tool=curl --form-string "str1=@literal" --form-string "str2=<verbatim;type=xxx/yyy" -F "file=@log/test39.txt;filename=fakerfile;type=moo/foobar" -F file2=@log/test39.txt
  28. </command>
  29. # We create this file before the command is invoked!
  30. <file name="log/test39.txt">
  31. foo bar
  32. This is a bar foo
  33. bar
  34. foo
  35. </file>
  36. </client>
  37. # Verify data after the test has been "shot"
  38. <verify>
  39. <strip>
  40. ^(User-Agent:|Content-Type: multipart/form-data;|-------).*
  41. </strip>
  42. <protocol>
  43. POST /we/want/39 HTTP/1.1
  44. User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
  45. Host: %HOSTIP:%HTTPPORT
  46. Accept: */*
  47. Content-Length: 810
  48. Expect: 100-continue
  49. Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32
  50. ------------------------------24e78000bd32
  51. Content-Disposition: form-data; name="name"
  52. daniel
  53. ------------------------------24e78000bd32
  54. Content-Disposition: form-data; name="tool"
  55. curl
  56. ------------------------------24e78000bd32
  57. Content-Disposition: form-data; name="str1"
  58. @literal
  59. ------------------------------24e78000bd32
  60. Content-Disposition: form-data; name="str2"
  61. <verbatim;type=xxx/yyy
  62. ------------------------------24e78000bd32
  63. Content-Disposition: form-data; name="file"; filename="fakerfile"
  64. Content-Type: moo/foobar
  65. foo bar
  66. This is a bar foo
  67. bar
  68. foo
  69. ------------------------------24e78000bd32
  70. Content-Disposition: form-data; name="file2"; filename="test39.txt"
  71. Content-Type: text/plain
  72. foo bar
  73. This is a bar foo
  74. bar
  75. foo
  76. ------------------------------24e78000bd32--
  77. </protocol>
  78. </verify>
  79. </testcase>