1<testcase> 2<info> 3<keywords> 4HTTP 5HTTP FORMPOST 6</keywords> 7</info> 8# Server-side 9<reply> 10<data> 11HTTP/1.1 200 OK 12Date: Thu, 09 Nov 2010 14:49:00 GMT 13Server: test-server/fake 14Content-Length: 10 15 16blablabla 17</data> 18</reply> 19 20# Client-side 21<client> 22<server> 23http 24</server> 25 <name> 26HTTP RFC1867-type formposting with filename= and type= 27 </name> 28 <command> 29http://%HOSTIP:%HTTPPORT/we/want/39 -F name=daniel -F tool=curl --form-string "str1=@literal" --form-string "str2=<verbatim;type=xxx/yyy" -F "file=@log/test39.txt;type=moo/foobar;filename=fakerfile" -F file2=@log/test39.txt -F "file3=@\"log/test39.txt\";type=mo/foo;filename=\"f\\\\\\\\ak\\\\\\er,\\\\an\\d;.t\\\"xt\"" -F 'file4=@"log/test39.txt"; filename="A\\AA\"\"\\\"ZZZ"' 30</command> 31# We create this file before the command is invoked! 32<file name="log/test39.txt"> 33foo bar 34This is a bar foo 35bar 36foo 37</file> 38</client> 39 40# Verify data after the test has been "shot" 41<verify> 42<strip> 43^(User-Agent:|Content-Type: multipart/form-data;|-------).* 44</strip> 45<protocol> 46POST /we/want/39 HTTP/1.1 47User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3 48Host: %HOSTIP:%HTTPPORT 49Accept: */* 50Content-Length: 1184 51Expect: 100-continue 52Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32 53 54------------------------------24e78000bd32 55Content-Disposition: form-data; name="name" 56 57daniel 58------------------------------24e78000bd32 59Content-Disposition: form-data; name="tool" 60 61curl 62------------------------------24e78000bd32 63Content-Disposition: form-data; name="str1" 64 65@literal 66------------------------------24e78000bd32 67Content-Disposition: form-data; name="str2" 68 69<verbatim;type=xxx/yyy 70------------------------------24e78000bd32 71Content-Disposition: form-data; name="file"; filename="fakerfile" 72Content-Type: moo/foobar 73 74foo bar 75This is a bar foo 76bar 77foo 78 79------------------------------24e78000bd32 80Content-Disposition: form-data; name="file2"; filename="test39.txt" 81Content-Type: text/plain 82 83foo bar 84This is a bar foo 85bar 86foo 87 88------------------------------24e78000bd32 89Content-Disposition: form-data; name="file3"; filename="f\\\\ak\\\\er,\\an\\d;.t\"xt" 90Content-Type: mo/foo 91 92foo bar 93This is a bar foo 94bar 95foo 96 97------------------------------24e78000bd32 98Content-Disposition: form-data; name="file4"; filename="A\\AA\"\"\\\"ZZZ" 99Content-Type: text/plain 100 101foo bar 102This is a bar foo 103bar 104foo 105 106------------------------------24e78000bd32-- 107</protocol> 108</verify> 109</testcase> 110