blob: 5230972220631b5d1b513aeeb53a8e6e0b18d8f7 [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001<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-z0-9]*/------------------------------/
66s/boundary=------------------------[a-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
7976
80------------------------------
81Content-Disposition: form-data; name="sendfile"; filename="postit2.c"
82
83d
841
85u
861
87m
881
89m
901
91y
921
93
94
9565
96
97------------------------------
98Content-Disposition: form-data; name="callbackdata"
99
100
1011
102d
1031
104u
1051
106m
1071
108m
1091
110y
1111
112
113
114%if hyper
11519A
116%else
11719a
118%endif
119
120------------------------------
121Content-Disposition: form-data; name="filename"
122
123postit2.c
124------------------------------
125Content-Disposition: form-data; name="submit"
126
127send
128------------------------------
129Content-Disposition: form-data; name="somename"; filename="somefile.txt"
130Content-Type: text/plain
131
132blah blah
133--------------------------------
134
1350
136
137POST /%TESTNUMBER HTTP/1.1
138Host: %HOSTIP:%HTTPPORT
139Accept: */*
140Transfer-Encoding: chunked
141Content-Type: multipart/form-data; boundary=----------------------------
142Expect: 100-continue
143
14484
145------------------------------
146Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"
147
148d
1491
150u
1511
152m
1531
154m
1551
156y
1571
158
159
16065
161
162------------------------------
163Content-Disposition: form-data; name="callbackdata"
164
165
1661
167d
1681
169u
1701
171m
1721
173m
1741
175y
1761
177
178
179%if hyper
18019A
181%else
18219a
183%endif
184
185------------------------------
186Content-Disposition: form-data; name="filename"
187
188postit2.c
189------------------------------
190Content-Disposition: form-data; name="submit"
191
192send
193------------------------------
194Content-Disposition: form-data; name="somename"; filename="somefile.txt"
195Content-Type: text/plain
196
197blah blah
198--------------------------------
199
2000
201
202</protocol>
203</verify>
204</testcase>