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 containing '"'
27</name>
28<command>
29http://%HOSTIP:%HTTPPORT/we/want/1158 -F "file=@\"log/test1158\\\".txt\";type=mo/foo;filename=\"test1158\\\".txt\"" -F 'file2=@"log/test1158\".txt"' -F 'file3=@"log/test1158\".txt";type=m/f,"log/test1158\".txt"'
30</command>
31<precheck>
32perl -e "print 'Test requires a system supporting double quotes in file names' if ($^O eq 'msys');"
33</precheck>
34# We create this file before the command is invoked!
35<file name=log/test1158".txt>
36foo bar
37This is a bar foo
38bar
39foo
40</file>
41</client>
42
43# Verify data after the test has been "shot"
44<verify>
45<strip>
46^(User-Agent:|Content-Type: multipart/form-data;|Content-Type: multipart/mixed; boundary=|-------).*
47</strip>
48<protocol>
49POST /we/want/1158 HTTP/1.1
50User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
51Host: %HOSTIP:%HTTPPORT
52Accept: */*
53Content-Length: 954
54Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32
55
56------------------------------24e78000bd32
57Content-Disposition: form-data; name="file"; filename="test1158\".txt"
58Content-Type: mo/foo
59
60foo bar
61This is a bar foo
62bar
63foo
64
65------------------------------24e78000bd32
66Content-Disposition: form-data; name="file2"; filename="test1158\".txt"
67Content-Type: text/plain
68
69foo bar
70This is a bar foo
71bar
72foo
73
74------------------------------24e78000bd32
75Content-Disposition: form-data; name="file3"
76Content-Type: multipart/mixed; boundary=----------------------------7f0e85a48b0b
77
78Content-Disposition: attachment; filename="test1158\".txt"
79Content-Type: m/f
80
81foo bar
82This is a bar foo
83bar
84foo
85
86Content-Disposition: attachment; filename="test1158\".txt"
87Content-Type: text/plain
88
89foo bar
90This is a bar foo
91bar
92foo
93
94
95------------------------------24e78000bd32--
96</protocol>
97</verify>
98</testcase>
99