2
0

test166 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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: Tue, 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. <features>
  21. Mime
  22. </features>
  23. <server>
  24. http
  25. </server>
  26. <name>
  27. HTTP formpost a file with spaces in name
  28. </name>
  29. <command>
  30. http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F "name=@%LOGDIR/fie ld %TESTNUMBER"
  31. </command>
  32. # We create this file before the command is invoked!
  33. <file name="%LOGDIR/fie ld %TESTNUMBER">
  34. data inside the file
  35. </file>
  36. </client>
  37. # Verify data after the test has been "shot"
  38. <verify>
  39. <strip>
  40. ^(Content-Type: multipart/form-data;|------------).*
  41. </strip>
  42. <protocol>
  43. POST /we/want/%TESTNUMBER HTTP/1.1
  44. Host: %HOSTIP:%HTTPPORT
  45. User-Agent: curl/%VERSION
  46. Accept: */*
  47. Content-Length: 235
  48. Content-Type: multipart/form-data; boundary=----------------------------b0b3d6d23991
  49. ------------------------------b0b3d6d23991
  50. Content-Disposition: form-data; name="name"; filename="fie ld %TESTNUMBER"
  51. Content-Type: application/octet-stream
  52. data inside the file
  53. ------------------------------b0b3d6d23991--
  54. </protocol>
  55. </verify>
  56. </testcase>