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: Thu, 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<server>
24http
25</server>
26 <name>
27HTTP multipart formpost with contents from a file
28 </name>
29 <command>
30http://%HOSTIP:%HTTPPORT/we/want/163 -F "name=<log/field163" -F tool=curl
31</command>
32# We create this file before the command is invoked!
33<file name="log/field163">
34contents
35from
36a
37file
38
39newlinens?
40yes please
41
42[tab][CR] too
43</file>
44</client>
45
46# Verify data after the test has been "shot"
47<verify>
48<strip>
49^(User-Agent:|Content-Type: multipart/form-data;|------------).*
50</strip>
51<protocol>
52POST /we/want/163 HTTP/1.1
53User-Agent: curl/7.11.2-CVS (i686-pc-linux-gnu) libcurl/7.11.2-CVS OpenSSL/0.9.6b zlib/1.1.4 c-ares/1.0.0
54Host: %HOSTIP:%HTTPPORT
55Accept: */*
56Content-Length: 304
57Content-Type: multipart/form-data; boundary=----------------------------c2d1767eb6ac
58
59------------------------------c2d1767eb6ac
60Content-Disposition: form-data; name="name"
61
62contents
63from
64a
65file
66
67newlinens?
68yes please
69
70[tab][CR] too
71
72------------------------------c2d1767eb6ac
73Content-Disposition: form-data; name="tool"
74
75curl
76------------------------------c2d1767eb6ac--
77</protocol>
78</verify>
79</testcase>
80