xref: /curl/tests/data/test645 (revision fc3e1cbc)
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<features>
43Mime
44</features>
45<server>
46http
47</server>
48# tool is what to use instead of 'curl'
49<tool>
50lib%TESTNUMBER
51</tool>
52
53<name>
54HTTP multi-part chunked mimepost using read callback for the file part
55</name>
56<command>
57http://%HOSTIP:%HTTPPORT/%TESTNUMBER
58</command>
59</client>
60
61#
62# Verify data after the test has been "shot"
63<verify>
64<strippart>
65s/^--------------------------[A-Za-z0-9]*/------------------------------/
66s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/
67</strippart>
68# Note that the stripping above removes 12 bytes from every occurrence of the
69# boundary string and since 5 of them are in the body contents, we see
70# (5*12) == 60 bytes less
71<protocol>
72POST /%TESTNUMBER HTTP/1.1
73Host: %HOSTIP:%HTTPPORT
74Accept: */*
75Transfer-Encoding: chunked
76Content-Type: multipart/form-data; boundary=----------------------------
77Expect: 100-continue
78
797c
80------------------------------
81Content-Disposition: form-data; name="sendfile"; filename="postit2.c"
82
83d
841
85u
861
87m
881
89m
901
91y
921
93
94
956b
96
97------------------------------
98Content-Disposition: form-data; name="callbackdata"
99
100
1011
102d
1031
104u
1051
106m
1071
108m
1091
110y
1111
112
113
1141b2
115
116------------------------------
117Content-Disposition: form-data; name="filename"
118
119postit2.c
120------------------------------
121Content-Disposition: form-data; name="submit"
122
123send
124------------------------------
125Content-Disposition: form-data; name="somename"; filename="somefile.txt"
126Content-Type: text/plain
127
128blah blah
129--------------------------------
130
1310
132
133POST /%TESTNUMBER HTTP/1.1
134Host: %HOSTIP:%HTTPPORT
135Accept: */*
136Transfer-Encoding: chunked
137Content-Type: multipart/form-data; boundary=----------------------------
138Expect: 100-continue
139
1408a
141------------------------------
142Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"
143
144d
1451
146u
1471
148m
1491
150m
1511
152y
1531
154
155
1566b
157
158------------------------------
159Content-Disposition: form-data; name="callbackdata"
160
161
1621
163d
1641
165u
1661
167m
1681
169m
1701
171y
1721
173
174
1751b2
176
177------------------------------
178Content-Disposition: form-data; name="filename"
179
180postit2.c
181------------------------------
182Content-Disposition: form-data; name="submit"
183
184send
185------------------------------
186Content-Disposition: form-data; name="somename"; filename="somefile.txt"
187Content-Type: text/plain
188
189blah blah
190--------------------------------
191
1920
193
194</protocol>
195</verify>
196</testcase>
197