test186 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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: 11
  15. blablabla
  16. </data>
  17. </reply>
  18. # Client-side
  19. <client>
  20. <server>
  21. http
  22. </server>
  23. <name>
  24. HTTP RFC1867-type formposting with types on text fields
  25. </name>
  26. <command>
  27. http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F "name=daniel;type=moo/foo" -F "html= <body>hello</body>;type=text/html;charset=verymoo"
  28. </command>
  29. # We create this file before the command is invoked!
  30. </client>
  31. # Verify data after the test has been "shot"
  32. <verify>
  33. <strip>
  34. ^(Content-Type: multipart/form-data;|------------).*
  35. </strip>
  36. <protocol>
  37. POST /we/want/%TESTNUMBER HTTP/1.1
  38. Host: %HOSTIP:%HTTPPORT
  39. User-Agent: curl/%VERSION
  40. Accept: */*
  41. Content-Length: 320
  42. Content-Type: multipart/form-data; boundary=----------------------------212d9006ceb5
  43. ------------------------------212d9006ceb5
  44. Content-Disposition: form-data; name="name"
  45. Content-Type: moo/foo
  46. daniel
  47. ------------------------------212d9006ceb5
  48. Content-Disposition: form-data; name="html"
  49. Content-Type: text/html;charset=verymoo
  50. <body>hello</body>
  51. ------------------------------212d9006ceb5--
  52. </protocol>
  53. </verify>
  54. </testcase>