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