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