Imported Upstream version 7.48.0
[platform/upstream/curl.git] / tests / data / test259
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP FORMPOST
6 HTTP proxy
7 HTTP proxy Digest auth
8 --proxy-anyauth
9 </keywords>
10 </info>
11 # Server-side
12 <reply>
13 # The stupid test server doesn't response anything at all until the full
14 # request has been sent, and then of course the full POST has already been
15 # sent!
16 <data>
17 HTTP/1.1 407 no, tell me who you are first
18 Date: Thu, 09 Nov 2010 14:49:00 GMT
19 Server: test-server/fake
20 Proxy-Authenticate: Digest realm="many secrets", nonce="911"
21 Content-Length: 0
22
23 </data>
24 <data1000>
25 HTTP/1.1 200 A OK\r
26 Server: Microsoft-IIS/6.0\r
27 Content-Type: text/html; charset=iso-8859-1\r
28 Content-Length: 3\r
29 \r
30 ok
31 </data1000>
32 <datacheck>
33 HTTP/1.1 407 no, tell me who you are first
34 Date: Thu, 09 Nov 2010 14:49:00 GMT
35 Server: test-server/fake
36 Proxy-Authenticate: Digest realm="many secrets", nonce="911"
37 Content-Length: 0
38
39 HTTP/1.1 200 A OK\r
40 Server: Microsoft-IIS/6.0\r
41 Content-Type: text/html; charset=iso-8859-1\r
42 Content-Length: 3\r
43 \r
44 ok
45 </datacheck>
46
47 </reply>
48
49 # Client-side
50 <client>
51 <server>
52 http
53 </server>
54 <features>
55 !SSPI
56 crypto
57 </features>
58  <name>
59 HTTP POST multipart with Expect: header using proxy anyauth (Digest)
60  </name>
61  <command>
62 -x http://%HOSTIP:%HTTPPORT http://remotehost:54321/we/want/259 -F name=daniel -F tool=curl -F file=@log/test259.txt -U uuuser:pppassword --proxy-anyauth
63 </command>
64 # We create this file before the command is invoked!
65 <file name="log/test259.txt">
66 foo-
67 This is a moo-
68 bar
69 </file>
70 </client>
71
72 # Verify data after the test has been "shot"
73 <verify>
74 <strip>
75 ^(User-Agent:|Content-Type: multipart/form-data;|------).*
76 </strip>
77 <protocol>
78 POST http://remotehost:54321/we/want/259 HTTP/1.1\r
79 Host: remotehost:54321\r
80 User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3\r
81 Accept: */*\r
82 Content-Length: 409\r
83 Expect: 100-continue\r
84 Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce\r
85 \r
86 ------------------------------7c633d5c27ce\r
87 Content-Disposition: form-data; name="name"\r
88 \r
89 daniel\r
90 ------------------------------7c633d5c27ce\r
91 Content-Disposition: form-data; name="tool"\r
92 \r
93 curl\r
94 ------------------------------7c633d5c27ce\r
95 Content-Disposition: form-data; name="file"; filename="test259.txt"\r
96 Content-Type: text/plain\r
97 \r
98 foo-
99 This is a moo-
100 bar
101 \r
102 ------------------------------7c633d5c27ce--\r
103 POST http://remotehost:54321/we/want/259 HTTP/1.1\r
104 Host: remotehost:54321\r
105 User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3\r
106 Proxy-Authorization: Digest username="uuuser", realm="many secrets", nonce="911", uri="/we/want/259", response="b479994d13e60f3aa192a67c5892ddc5"\r
107 Accept: */*\r
108 Content-Length: 409\r
109 Expect: 100-continue\r
110 Content-Type: multipart/form-data; boundary=----------------------------7c633d5c27ce\r
111 \r
112 ------------------------------7c633d5c27ce\r
113 Content-Disposition: form-data; name="name"\r
114 \r
115 daniel\r
116 ------------------------------7c633d5c27ce\r
117 Content-Disposition: form-data; name="tool"\r
118 \r
119 curl\r
120 ------------------------------7c633d5c27ce\r
121 Content-Disposition: form-data; name="file"; filename="test259.txt"\r
122 Content-Type: text/plain\r
123 \r
124 foo-
125 This is a moo-
126 bar
127 \r
128 ------------------------------7c633d5c27ce--\r
129 </protocol>
130 </verify>
131 </testcase>