2
0

test1315 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <testcase>
  2. # Based on tests 186 and 1053
  3. <info>
  4. <keywords>
  5. HTTP
  6. HTTP FORMPOST
  7. HTTP file upload
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. <data>
  13. HTTP/1.1 200 OK
  14. Date: Thu, 29 Jul 2008 14:49:00 GMT
  15. Server: test-server/fake
  16. Content-Length: 0
  17. Connection: close
  18. </data>
  19. </reply>
  20. # Client-side
  21. <client>
  22. <server>
  23. http
  24. </server>
  25. <name>
  26. HTTP RFC1867-type formposting - -F with three files, one with explicit type
  27. </name>
  28. <command>
  29. http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F name=value -F 'file=@log/test%TESTNUMBER.txt,log/test%TESTNUMBER.txt;type=magic/content,log/test%TESTNUMBER.txt'
  30. </command>
  31. # We create this file before the command is invoked!
  32. <file name="log/test%TESTNUMBER.txt">
  33. dummy data
  34. </file>
  35. </client>
  36. # Verify data after the test has been "shot"
  37. <verify>
  38. <strip>
  39. -----+\w+
  40. </strip>
  41. <protocol>
  42. POST /we/want/%TESTNUMBER HTTP/1.1
  43. Host: %HOSTIP:%HTTPPORT
  44. User-Agent: curl/%VERSION
  45. Accept: */*
  46. Content-Length: 797
  47. Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763
  48. ------------------------------9ef8d6205763
  49. Content-Disposition: form-data; name="name"
  50. value
  51. ------------------------------9ef8d6205763
  52. Content-Disposition: form-data; name="file"
  53. Content-Type: multipart/mixed; boundary=----------------------------aaaaaaaaaaaa
  54. Content-Disposition: attachment; filename="test%TESTNUMBER.txt"
  55. Content-Type: text/plain
  56. dummy data
  57. ------------------------------9ef8d6205763
  58. Content-Disposition: attachment; filename="test%TESTNUMBER.txt"
  59. Content-Type: magic/content
  60. dummy data
  61. ------------------------------9ef8d6205763
  62. Content-Disposition: attachment; filename="test%TESTNUMBER.txt"
  63. Content-Type: text/plain
  64. dummy data
  65. ------------------------------aaaaaaaaaaaa--
  66. ------------------------------9ef8d6205763--
  67. </protocol>
  68. </verify>
  69. </testcase>