test2073 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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: Tue, 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: Tue, 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/%TESTNUMBER -F 'name=a;filename=a.pdf' --next http://%HOSTIP:%HTTPPORT/%TESTNUMBER -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. ^(Content-Type: multipart/form-data;|------------).*
  42. </strip>
  43. <protocol>
  44. POST /%TESTNUMBER HTTP/1.1
  45. Host: %HOSTIP:%HTTPPORT
  46. User-Agent: curl/%VERSION
  47. Accept: */*
  48. Content-Length: 189
  49. Content-Disposition: form-data; name="name"; filename="a.pdf"
  50. Content-Type: application/pdf
  51. a
  52. POST /%TESTNUMBER HTTP/1.1
  53. Host: %HOSTIP:%HTTPPORT
  54. User-Agent: curl/%VERSION
  55. Accept: */*
  56. Content-Length: 184
  57. Content-Disposition: form-data; name="name"; filename="b.jpg"
  58. Content-Type: image/jpeg
  59. b
  60. </protocol>
  61. </verify>
  62. </testcase>