• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP POST
6HTTP MIME POST
7</keywords>
8</info>
9
10#
11# Server-side
12<reply>
13<data>
14HTTP/1.1 200 OK
15Date: Tue, 09 Nov 2010 14:49:00 GMT
16Server: test-server/fake swsclose
17Connection: close
18Content-Type: text/html
19
20hello
21</data>
22<datacheck>
23HTTP/1.1 200 OK
24Date: Tue, 09 Nov 2010 14:49:00 GMT
25Server: test-server/fake swsclose
26Connection: close
27Content-Type: text/html
28
29hello
30HTTP/1.1 200 OK
31Date: Tue, 09 Nov 2010 14:49:00 GMT
32Server: test-server/fake swsclose
33Connection: close
34Content-Type: text/html
35
36hello
37</datacheck>
38</reply>
39
40# Client-side
41<client>
42<server>
43http
44</server>
45# tool is what to use instead of 'curl'
46<tool>
47lib%TESTNUMBER
48</tool>
49
50 <name>
51HTTP multi-part chunked mimepost using read callback for the file part
52 </name>
53 <command>
54http://%HOSTIP:%HTTPPORT/%TESTNUMBER
55</command>
56</client>
57
58#
59# Verify data after the test has been "shot"
60<verify>
61<strippart>
62s/^--------------------------[a-z0-9]*/------------------------------/
63s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/
64</strippart>
65# Note that the stripping above removes 12 bytes from every occurrence of the
66# boundary string and since 5 of them are in the body contents, we see
67# (5*12) == 60 bytes less
68<protocol>
69POST /%TESTNUMBER HTTP/1.1
70Host: %HOSTIP:%HTTPPORT
71Accept: */*
72Transfer-Encoding: chunked
73Content-Type: multipart/form-data; boundary=----------------------------
74Expect: 100-continue
75
7676
77------------------------------
78Content-Disposition: form-data; name="sendfile"; filename="postit2.c"
79
80d
811
82u
831
84m
851
86m
871
88y
891
90
91
9265
93
94------------------------------
95Content-Disposition: form-data; name="callbackdata"
96
97
981
99d
1001
101u
1021
103m
1041
105m
1061
107y
1081
109
110
111%if hyper
11219A
113%else
11419a
115%endif
116
117------------------------------
118Content-Disposition: form-data; name="filename"
119
120postit2.c
121------------------------------
122Content-Disposition: form-data; name="submit"
123
124send
125------------------------------
126Content-Disposition: form-data; name="somename"; filename="somefile.txt"
127Content-Type: text/plain
128
129blah blah
130--------------------------------
131
1320
133
134POST /%TESTNUMBER HTTP/1.1
135Host: %HOSTIP:%HTTPPORT
136Accept: */*
137Transfer-Encoding: chunked
138Content-Type: multipart/form-data; boundary=----------------------------
139Expect: 100-continue
140
14184
142------------------------------
143Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"
144
145d
1461
147u
1481
149m
1501
151m
1521
153y
1541
155
156
15765
158
159------------------------------
160Content-Disposition: form-data; name="callbackdata"
161
162
1631
164d
1651
166u
1671
168m
1691
170m
1711
172y
1731
174
175
176%if hyper
17719A
178%else
17919a
180%endif
181
182------------------------------
183Content-Disposition: form-data; name="filename"
184
185postit2.c
186------------------------------
187Content-Disposition: form-data; name="submit"
188
189send
190------------------------------
191Content-Disposition: form-data; name="somename"; filename="somefile.txt"
192Content-Type: text/plain
193
194blah blah
195--------------------------------
196
1970
198
199</protocol>
200</verify>
201</testcase>
202