test173 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: 11
  15. blablabla
  16. </data>
  17. </reply>
  18. # Client-side
  19. <client>
  20. <server>
  21. http
  22. </server>
  23. <name>
  24. HTTP RFC1867-formpost a file from stdin with "faked" filename
  25. </name>
  26. <command>
  27. http://%HOSTIP:%HTTPPORT/we/want/173 -F field1=contents1 -F "fileupload=@-;filename=/dev/null;type=text/x-null;format=x-curl"
  28. </command>
  29. <stdin>
  30. line1
  31. line2
  32. line3
  33. line4
  34. line5
  35. line6
  36. line7
  37. line8
  38. </stdin>
  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/173 HTTP/1.1
  47. User-Agent: curl/7.12.1-CVS (i686-pc-linux-gnu) libcurl/7.12.1-CVS OpenSSL/0.9.6b ipv6 zlib/1.1.4 GSS libidn/0.4.6
  48. Host: %HOSTIP:%HTTPPORT
  49. Accept: */*
  50. Content-Length: 360
  51. Expect: 100-continue
  52. Content-Type: multipart/form-data; boundary=----------------------------5dbea401cd8c
  53. ------------------------------5dbea401cd8c
  54. Content-Disposition: form-data; name="field1"
  55. contents1
  56. ------------------------------5dbea401cd8c
  57. Content-Disposition: form-data; name="fileupload"; filename="/dev/null"
  58. Content-Type: text/x-null;format=x-curl
  59. line1
  60. line2
  61. line3
  62. line4
  63. line5
  64. line6
  65. line7
  66. line8
  67. ------------------------------5dbea401cd8c--
  68. </protocol>
  69. </verify>
  70. </testcase>