xref: /curl/tests/data/test163 (revision 3fd80c7b)
1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP POST
6</keywords>
7</info>
8
9# Server-side
10<reply>
11<data>
12HTTP/1.1 200 OK swsclose
13Date: Tue, 09 Nov 2010 14:49:00 GMT
14Server: test-server/fake
15Content-Length: 10
16
17blablabla
18</data>
19</reply>
20
21# Client-side
22<client>
23<features>
24Mime
25</features>
26<server>
27http
28</server>
29<name>
30HTTP multipart formpost with contents from a file
31</name>
32<command>
33http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F "name=<%LOGDIR/field%TESTNUMBER" -F tool=curl
34</command>
35# We create this file before the command is invoked!
36<file name="%LOGDIR/field%TESTNUMBER">
37contents
38from
39a
40file
41
42newlinens?
43yes please
44
45[tab][CR] too
46</file>
47</client>
48
49# Verify data after the test has been "shot"
50<verify>
51<strip>
52^(Content-Type: multipart/form-data;|------------).*
53</strip>
54<protocol>
55POST /we/want/%TESTNUMBER HTTP/1.1
56Host: %HOSTIP:%HTTPPORT
57User-Agent: curl/%VERSION
58Accept: */*
59Content-Length: 322
60Content-Type: multipart/form-data; boundary=----------------------------c2d1767eb6ac
61
62------------------------------c2d1767eb6ac
63Content-Disposition: form-data; name="name"
64
65contents
66from
67a
68file
69
70newlinens?
71yes please
72
73[tab][CR] too
74
75------------------------------c2d1767eb6ac
76Content-Disposition: form-data; name="tool"
77
78curl
79------------------------------c2d1767eb6ac--
80</protocol>
81</verify>
82</testcase>
83