test166 1.1 KB

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