| 1 |
# Server-side |
| 2 |
<reply> |
| 3 |
<data> |
| 4 |
HTTP/1.1 200 OK swsclose |
| 5 |
Date: Thu, 09 Nov 2010 14:49:00 GMT |
| 6 |
Server: test-server/fake |
| 7 |
|
| 8 |
blablabla |
| 9 |
</data> |
| 10 |
</reply> |
| 11 |
|
| 12 |
# Client-side |
| 13 |
<client> |
| 14 |
<server> |
| 15 |
http |
| 16 |
</server> |
| 17 |
<name> |
| 18 |
HTTP multipart formpost with contents from a file |
| 19 |
</name> |
| 20 |
<command> |
| 21 |
http://%HOSTIP:%HTTPPORT/we/want/163 -F "name=<log/field163" -F tool=curl |
| 22 |
</command> |
| 23 |
# We create this file before the command is invoked! |
| 24 |
<file name="log/field163"> |
| 25 |
contents |
| 26 |
from |
| 27 |
a |
| 28 |
file |
| 29 |
|
| 30 |
newlinens? |
| 31 |
yes please |
| 32 |
|
| 33 |
[tab][CR] too |
| 34 |
</file> |
| 35 |
</client> |
| 36 |
|
| 37 |
# Verify data after the test has been "shot" |
| 38 |
<verify> |
| 39 |
<strip> |
| 40 |
^(User-Agent:|Content-Type: multipart/form-data;|------------).* |
| 41 |
</strip> |
| 42 |
<protocol> |
| 43 |
POST /we/want/163 HTTP/1.1 |
| 44 |
User-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 |
| 45 |
Host: 127.0.0.1:%HTTPPORT |
| 46 |
Accept: */* |
| 47 |
Content-Length: 304 |
| 48 |
Expect: 100-continue |
| 49 |
Content-Type: multipart/form-data; boundary=----------------------------c2d1767eb6ac |
| 50 |
|
| 51 |
------------------------------c2d1767eb6ac |
| 52 |
Content-Disposition: form-data; name="name" |
| 53 |
|
| 54 |
contents |
| 55 |
from |
| 56 |
a |
| 57 |
file |
| 58 |
|
| 59 |
newlinens? |
| 60 |
yes please |
| 61 |
|
| 62 |
[tab][CR] too |
| 63 |
|
| 64 |
------------------------------c2d1767eb6ac |
| 65 |
Content-Disposition: form-data; name="tool" |
| 66 |
|
| 67 |
curl |
| 68 |
------------------------------c2d1767eb6ac-- |
| 69 |
</protocol> |
| 70 |
</verify> |