xref: /curl/tests/data/test668 (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:4f: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:4f:00 GMT
25Server: test-server/fake swsclose
26Connection: close
27Content-Type: text/html
28
29hello
30</datacheck>
31</reply>
32
33# Client-side
34<client>
35<features>
36Mime
37</features>
38<server>
39http
40</server>
41# tool is what to use instead of 'curl'
42<tool>
43lib%TESTNUMBER
44</tool>
45
46<name>
47HTTP mimepost early end of data detection
48</name>
49<command>
50http://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/file%TESTNUMBER.txt
51</command>
52<file name="%LOGDIR/file%TESTNUMBER.txt">
53This is data from a file
54</file>
55</client>
56
57#
58# Verify data after the test has been "shot"
59<verify>
60<strippart>
61s/^--------------------------[A-Za-z0-9]*/------------------------------/
62s/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/
63</strippart>
64# Note that the stripping above removes 12 bytes from every occurrence of the
65# boundary string and since 5 of them are in the body contents, we see
66# (5*12) == 60 bytes less
67<protocol>
68POST /%TESTNUMBER HTTP/1.1
69Host: %HOSTIP:%HTTPPORT
70Accept: */*
71Transfer-Encoding: chunked
72Content-Type: multipart/form-data; boundary=----------------------------
73Expect: 100-continue
74
75%if hyper
76CD
77%else
78cd
79%endif
80------------------------------
81Content-Disposition: form-data; name="field1"
82
83dummy
84------------------------------
85Content-Disposition: form-data; name="field2"
86
87
885
89dummy
9097
91
92------------------------------
93Content-Disposition: form-data; name="field3"; filename="file%TESTNUMBER.txt"
94Content-Type: text/plain
95
96
97%if hyper
984F
99%else
1004f
101%endif
102This is data from a file
103
104--------------------------------
105
1060
107
108</protocol>
109</verify>
110</testcase>
111