test1105 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP POST
  6. cookies
  7. cookiejar
  8. </keywords>
  9. </info>
  10. # Server-side
  11. <reply>
  12. <data>
  13. HTTP/1.1 200 OK
  14. Date: Tue, 09 Nov 2010 14:49:00 GMT
  15. Server: test-server/fake
  16. Content-Type: text/html
  17. Funny-head: yesyes swsclose
  18. Set-Cookie: foobar=name;
  19. Set-Cookie: mismatch=this; domain=127.0.0.1; path="/silly/";
  20. Set-Cookie: partmatch=present; domain=.0.0.1; path=/;
  21. </data>
  22. </reply>
  23. # Client-side
  24. <client>
  25. <server>
  26. http
  27. </server>
  28. <name>
  29. HTTP with cookie parser and header recording
  30. </name>
  31. <command>
  32. "http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER?parm1=this*that/other/thing&parm2=foobar/%TESTNUMBER" -c log/cookie%TESTNUMBER.txt -d "userid=myname&password=mypassword"
  33. </command>
  34. <precheck>
  35. perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
  36. </precheck>
  37. </client>
  38. # Verify data after the test has been "shot"
  39. <verify>
  40. <protocol nonewline="yes">
  41. POST /we/want/%TESTNUMBER?parm1=this*that/other/thing&parm2=foobar/%TESTNUMBER HTTP/1.1
  42. Host: %HOSTIP:%HTTPPORT
  43. User-Agent: curl/%VERSION
  44. Accept: */*
  45. Content-Length: 33
  46. Content-Type: application/x-www-form-urlencoded
  47. userid=myname&password=mypassword
  48. </protocol>
  49. <file name="log/cookie%TESTNUMBER.txt" mode="text">
  50. # Netscape HTTP Cookie File
  51. # https://curl.se/docs/http-cookies.html
  52. # This file was generated by libcurl! Edit at your own risk.
  53. 127.0.0.1 FALSE "/silly/" FALSE 0 mismatch this
  54. 127.0.0.1 FALSE /we/want/ FALSE 0 foobar name
  55. </file>
  56. </verify>
  57. </testcase>