test2073 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP FORMPOST
  6. </keywords>
  7. </info>
  8. #
  9. # Server-side
  10. <reply>
  11. <data>
  12. HTTP/1.1 200 OK
  13. Date: Thu, 09 Nov 2010 14:49:00 GMT
  14. Content-Length: 10
  15. contents1
  16. </data>
  17. <data1>
  18. HTTP/1.1 200 OK
  19. Date: Thu, 09 Nov 2010 14:49:00 GMT
  20. Content-Length: 10
  21. contents2
  22. </data1>
  23. </reply>
  24. #
  25. # Client-side
  26. <client>
  27. <server>
  28. http
  29. </server>
  30. <name>
  31. HTTP form posts with handle reset
  32. </name>
  33. <command>
  34. http://%HOSTIP:%HTTPPORT/2073 -F 'name=a;filename=a.pdf' --next http://%HOSTIP:%HTTPPORT/2073 -F 'name=b;filename=b.jpg'
  35. </command>
  36. </client>
  37. #
  38. # Verify data after the test has been "shot"
  39. <verify>
  40. <strip>
  41. ^(User-Agent:|Content-Type: multipart/form-data;|------------).*
  42. </strip>
  43. <protocol>
  44. POST /2073 HTTP/1.1
  45. Host: %HOSTIP:%HTTPPORT
  46. Accept: */*
  47. Content-Length: 189
  48. Content-Disposition: form-data; name="name"; filename="a.pdf"
  49. Content-Type: application/pdf
  50. a
  51. POST /2073 HTTP/1.1
  52. Host: %HOSTIP:%HTTPPORT
  53. Accept: */*
  54. Content-Length: 184
  55. Content-Disposition: form-data; name="name"; filename="b.jpg"
  56. Content-Type: image/jpeg
  57. b
  58. </protocol>
  59. </verify>
  60. </testcase>