test1133 (2453B)
1 <testcase> 2 <info> 3 <keywords> 4 HTTP 5 HTTP FORMPOST 6 </keywords> 7 </info> 8 # Server-side 9 <reply> 10 <data> 11 HTTP/1.1 200 OK 12 Date: Tue, 09 Nov 2010 14:49:00 GMT 13 Server: test-server/fake 14 Content-Length: 10 15 16 blablabla 17 </data> 18 </reply> 19 20 # Client-side 21 <client> 22 <features> 23 Mime 24 </features> 25 <server> 26 http 27 </server> 28 <name> 29 HTTP RFC1867-type formposting with filename/data contains ',', ';', '"' 30 </name> 31 <command> 32 http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F "file=@\"%LOGDIR/test%TESTNUMBER,and;.txt\";type=mo/foo;filename=\"faker,and;.txt\"" -F 'file2=@"%LOGDIR/test%TESTNUMBER,and;.txt"' -F 'file3=@"%LOGDIR/test%TESTNUMBER,and;.txt";type=m/f,"%LOGDIR/test%TESTNUMBER,and;.txt"' -F a="{\"field1\":\"value1\",\"field2\":\"value2\"}" -F 'b=" \\value1;type=\"whatever\" "; type=text/foo; charset=utf-8 ; filename=param_b' 33 </command> 34 # We create this file before the command is invoked! 35 <file name="%LOGDIR/test%TESTNUMBER,and;.txt"> 36 foo bar 37 This is a bar foo 38 bar 39 foo 40 </file> 41 </client> 42 43 # Verify data after the test has been "shot" 44 <verify> 45 <strip> 46 ^(Content-Type: multipart/form-data;|Content-Type: multipart/mixed; boundary=|-------).* 47 </strip> 48 <protocol> 49 POST /we/want/%TESTNUMBER HTTP/1.1 50 Host: %HOSTIP:%HTTPPORT 51 User-Agent: curl/%VERSION 52 Accept: */* 53 Content-Length: 1324 54 Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32 55 56 ------------------------------24e78000bd32 57 Content-Disposition: form-data; name="file"; filename="faker,and;.txt" 58 Content-Type: mo/foo 59 60 foo bar 61 This is a bar foo 62 bar 63 foo 64 65 ------------------------------24e78000bd32 66 Content-Disposition: form-data; name="file2"; filename="test%TESTNUMBER,and;.txt" 67 Content-Type: text/plain 68 69 foo bar 70 This is a bar foo 71 bar 72 foo 73 74 ------------------------------24e78000bd32 75 Content-Disposition: form-data; name="file3" 76 Content-Type: multipart/mixed; boundary=----------------------------7f0e85a48b0b 77 78 Content-Disposition: attachment; filename="test%TESTNUMBER,and;.txt" 79 Content-Type: m/f 80 81 foo bar 82 This is a bar foo 83 bar 84 foo 85 86 Content-Disposition: attachment; filename="test%TESTNUMBER,and;.txt" 87 Content-Type: text/plain 88 89 foo bar 90 This is a bar foo 91 bar 92 foo 93 94 95 Content-Disposition: form-data; name="a" 96 97 {"field1":"value1","field2":"value2"} 98 Content-Disposition: form-data; name="b"; filename="param_b" 99 Content-Type: text/foo; charset=utf-8 100 101 \value1;type="whatever" 102 ------------------------------24e78000bd32-- 103 </protocol> 104 </verify> 105 </testcase>