113498266Sopenharmony_ci<testcase>
213498266Sopenharmony_ci<info>
313498266Sopenharmony_ci<keywords>
413498266Sopenharmony_ciHTTP
513498266Sopenharmony_ciHTTP FORMPOST
613498266Sopenharmony_ci</keywords>
713498266Sopenharmony_ci</info>
813498266Sopenharmony_ci# Server-side
913498266Sopenharmony_ci<reply>
1013498266Sopenharmony_ci<data>
1113498266Sopenharmony_ciHTTP/1.1 200 OK
1213498266Sopenharmony_ciDate: Tue, 09 Nov 2010 14:49:00 GMT
1313498266Sopenharmony_ciServer: test-server/fake
1413498266Sopenharmony_ciContent-Length: 10
1513498266Sopenharmony_ci
1613498266Sopenharmony_ciblablabla
1713498266Sopenharmony_ci</data>
1813498266Sopenharmony_ci</reply>
1913498266Sopenharmony_ci
2013498266Sopenharmony_ci# Client-side
2113498266Sopenharmony_ci<client>
2213498266Sopenharmony_ci<features>
2313498266Sopenharmony_ciMime
2413498266Sopenharmony_ci</features>
2513498266Sopenharmony_ci<server>
2613498266Sopenharmony_cihttp
2713498266Sopenharmony_ci</server>
2813498266Sopenharmony_ci<name>
2913498266Sopenharmony_ciHTTP RFC1867-type formposting with filename/data contains ',', ';', '"'
3013498266Sopenharmony_ci</name>
3113498266Sopenharmony_ci<command>
3213498266Sopenharmony_cihttp://%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'
3313498266Sopenharmony_ci</command>
3413498266Sopenharmony_ci# We create this file before the command is invoked!
3513498266Sopenharmony_ci<file name="%LOGDIR/test%TESTNUMBER,and;.txt">
3613498266Sopenharmony_cifoo bar
3713498266Sopenharmony_ciThis is a bar foo
3813498266Sopenharmony_cibar
3913498266Sopenharmony_cifoo
4013498266Sopenharmony_ci</file>
4113498266Sopenharmony_ci</client>
4213498266Sopenharmony_ci
4313498266Sopenharmony_ci# Verify data after the test has been "shot"
4413498266Sopenharmony_ci<verify>
4513498266Sopenharmony_ci<strip>
4613498266Sopenharmony_ci^(Content-Type: multipart/form-data;|Content-Type: multipart/mixed; boundary=|-------).*
4713498266Sopenharmony_ci</strip>
4813498266Sopenharmony_ci<protocol>
4913498266Sopenharmony_ciPOST /we/want/%TESTNUMBER HTTP/1.1
5013498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
5113498266Sopenharmony_ciUser-Agent: curl/%VERSION
5213498266Sopenharmony_ciAccept: */*
5313498266Sopenharmony_ciContent-Length: 1324
5413498266Sopenharmony_ciContent-Type: multipart/form-data; boundary=----------------------------24e78000bd32
5513498266Sopenharmony_ci
5613498266Sopenharmony_ci------------------------------24e78000bd32
5713498266Sopenharmony_ciContent-Disposition: form-data; name="file"; filename="faker,and;.txt"
5813498266Sopenharmony_ciContent-Type: mo/foo
5913498266Sopenharmony_ci
6013498266Sopenharmony_cifoo bar
6113498266Sopenharmony_ciThis is a bar foo
6213498266Sopenharmony_cibar
6313498266Sopenharmony_cifoo
6413498266Sopenharmony_ci
6513498266Sopenharmony_ci------------------------------24e78000bd32
6613498266Sopenharmony_ciContent-Disposition: form-data; name="file2"; filename="test%TESTNUMBER,and;.txt"
6713498266Sopenharmony_ciContent-Type: text/plain
6813498266Sopenharmony_ci
6913498266Sopenharmony_cifoo bar
7013498266Sopenharmony_ciThis is a bar foo
7113498266Sopenharmony_cibar
7213498266Sopenharmony_cifoo
7313498266Sopenharmony_ci
7413498266Sopenharmony_ci------------------------------24e78000bd32
7513498266Sopenharmony_ciContent-Disposition: form-data; name="file3"
7613498266Sopenharmony_ciContent-Type: multipart/mixed; boundary=----------------------------7f0e85a48b0b
7713498266Sopenharmony_ci
7813498266Sopenharmony_ciContent-Disposition: attachment; filename="test%TESTNUMBER,and;.txt"
7913498266Sopenharmony_ciContent-Type: m/f
8013498266Sopenharmony_ci
8113498266Sopenharmony_cifoo bar
8213498266Sopenharmony_ciThis is a bar foo
8313498266Sopenharmony_cibar
8413498266Sopenharmony_cifoo
8513498266Sopenharmony_ci
8613498266Sopenharmony_ciContent-Disposition: attachment; filename="test%TESTNUMBER,and;.txt"
8713498266Sopenharmony_ciContent-Type: text/plain
8813498266Sopenharmony_ci
8913498266Sopenharmony_cifoo bar
9013498266Sopenharmony_ciThis is a bar foo
9113498266Sopenharmony_cibar
9213498266Sopenharmony_cifoo
9313498266Sopenharmony_ci
9413498266Sopenharmony_ci
9513498266Sopenharmony_ciContent-Disposition: form-data; name="a"
9613498266Sopenharmony_ci
9713498266Sopenharmony_ci{"field1":"value1","field2":"value2"}
9813498266Sopenharmony_ciContent-Disposition: form-data; name="b"; filename="param_b"
9913498266Sopenharmony_ciContent-Type: text/foo; charset=utf-8
10013498266Sopenharmony_ci
10113498266Sopenharmony_ci \value1;type="whatever" 
10213498266Sopenharmony_ci------------------------------24e78000bd32--
10313498266Sopenharmony_ci</protocol>
10413498266Sopenharmony_ci</verify>
10513498266Sopenharmony_ci</testcase>
106