xref: /curl/tests/data/test654 (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 duplicate easy handle with mime data
55</name>
56<command>
57http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/file%TESTNUMBER.txt
58</command>
59<file name="%LOGDIR/file%TESTNUMBER.txt">
60This is data from a file
61</file>
62</client>
63
64#
65# Verify data after the test has been "shot"
66<verify>
67<strippart>
68s/^--------------------------[A-Za-z0-9]*/------------------------------/
69s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/
70</strippart>
71# Note that the stripping above removes 12 bytes from every occurrence of the
72# boundary string and since 5 of them are in the body contents, we see
73# (5*12) == 60 bytes less
74<protocol>
75POST /%TESTNUMBER HTTP/1.1
76Host: %HOSTIP:%HTTPPORT
77Accept: */*
78Content-Length: 0
79
80POST /%TESTNUMBER HTTP/1.1
81Host: %HOSTIP:%HTTPPORT
82Accept: */*
83Transfer-Encoding: chunked
84Content-Type: multipart/form-data; boundary=----------------------------
85Expect: 100-continue
86
87%if hyper
881C1
89%else
901c1
91%endif
92------------------------------
93Content-Disposition: form-data; name="greeting"
94Content-Type: application/X-Greeting
95Content-Transfer-Encoding: base64
96X-Test-Number: %TESTNUMBER
97
98aGVsbG8=
99------------------------------
100Content-Disposition: form-data; filename="file%TESTNUMBER.txt"
101Content-Type: text/plain
102
103This is data from a file
104
105------------------------------
106Content-Disposition: form-data
107
108
1091
110d
1111
112u
1131
114m
1151
116m
1171
118y
1191
120
121
12236
123
124--------------------------------
125
1260
127
128</protocol>
129</verify>
130</testcase>
131