xref: /curl/tests/data/test645 (revision 3fd80c7b)
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
79%if hyper
807C
81%else
827c
83%endif
84------------------------------
85Content-Disposition: form-data; name="sendfile"; filename="postit2.c"
86
87d
881
89u
901
91m
921
93m
941
95y
961
97
98
99%if hyper
1006B
101%else
1026b
103%endif
104
105------------------------------
106Content-Disposition: form-data; name="callbackdata"
107
108
1091
110d
1111
112u
1131
114m
1151
116m
1171
118y
1191
120
121
122%if hyper
1231B2
124%else
1251b2
126%endif
127
128------------------------------
129Content-Disposition: form-data; name="filename"
130
131postit2.c
132------------------------------
133Content-Disposition: form-data; name="submit"
134
135send
136------------------------------
137Content-Disposition: form-data; name="somename"; filename="somefile.txt"
138Content-Type: text/plain
139
140blah blah
141--------------------------------
142
1430
144
145POST /%TESTNUMBER HTTP/1.1
146Host: %HOSTIP:%HTTPPORT
147Accept: */*
148Transfer-Encoding: chunked
149Content-Type: multipart/form-data; boundary=----------------------------
150Expect: 100-continue
151
152%if hyper
1538A
154%else
1558a
156%endif
157------------------------------
158Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"
159
160d
1611
162u
1631
164m
1651
166m
1671
168y
1691
170
171
172%if hyper
1736B
174%else
1756b
176%endif
177
178------------------------------
179Content-Disposition: form-data; name="callbackdata"
180
181
1821
183d
1841
185u
1861
187m
1881
189m
1901
191y
1921
193
194
195%if hyper
1961B2
197%else
1981b2
199%endif
200
201------------------------------
202Content-Disposition: form-data; name="filename"
203
204postit2.c
205------------------------------
206Content-Disposition: form-data; name="submit"
207
208send
209------------------------------
210Content-Disposition: form-data; name="somename"; filename="somefile.txt"
211Content-Type: text/plain
212
213blah blah
214--------------------------------
215
2160
217
218</protocol>
219</verify>
220</testcase>
221