Git init
[external/curl.git] / tests / data / test9
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP FORMPOST
6 HTTP file upload
7 </keywords>
8 </info>
9 # Server-side
10 <reply>
11 <data>
12 HTTP/1.0 200 OK swsclose
13 Date: Thu, 09 Nov 2010 14:49:00 GMT
14 Server: test-server/fake
15
16 blablabla
17
18 </data>
19 </reply>
20
21 # Client-side
22 <client>
23 <server>
24 http
25 </server>
26  <name>
27 HTTP RFC1867-type formposting
28  </name>
29  <command>
30 http://%HOSTIP:%HTTPPORT/we/want/9 -F name=daniel -F tool=curl -F file=@log/test9.txt
31 </command>
32 # We create this file before the command is invoked!
33 <file name="log/test9.txt">
34 foo-
35 This is a moo-
36 bar
37 </file>
38 </client>
39
40 # Verify data after the test has been "shot"
41 <verify>
42 <strip>
43 ^(User-Agent:|Content-Type: multipart/form-data;|------------).*
44 </strip>
45 <protocol>
46 POST /we/want/9 HTTP/1.1\r
47 User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3\r
48 Host: %HOSTIP:%HTTPPORT\r
49 Accept: */*\r
50 Content-Length: 407\r
51 Expect: 100-continue\r
52 Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763\r
53 \r
54 ------------------------------9ef8d6205763\r
55 Content-Disposition: form-data; name="name"\r
56 \r
57 daniel\r
58 ------------------------------9ef8d6205763\r
59 Content-Disposition: form-data; name="tool"\r
60 \r
61 curl\r
62 ------------------------------9ef8d6205763\r
63 Content-Disposition: form-data; name="file"; filename="test9.txt"\r
64 Content-Type: text/plain\r
65 \r
66 foo-
67 This is a moo-
68 bar
69 \r
70 ------------------------------9ef8d6205763--\r
71 </protocol>
72 </verify>
73 </testcase>