test39 1.7 KB

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