Imported Upstream version 7.50.2
[platform/upstream/curl.git] / tests / data / test1701
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP POST
6 HTTP/2
7 </keywords>
8 </info>
9
10 #
11 # Server-side
12 <reply>
13 <data nocheck="yes">
14 HTTP/1.1 200 OK
15 Date: Thu, 09 Nov 2010 14:49:00 GMT
16 Server: test-server/fake
17 Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
18 ETag: "21025-dc7-39462498"
19 Accept-Ranges: bytes
20 Content-Length: 6
21 Connection: close
22 Content-Type: text/html
23 Funny-head: yesyes
24
25 -foo-
26 </data>
27 </reply>
28
29 #
30 # Client-side
31 <client>
32 <server>
33 http
34 http/2
35 </server>
36  <name>
37 HTTP/2 POST with Upgrade:
38  </name>
39  <command>
40 http://%HOSTIP:%HTTP2PORT/1701 --http2 -d "datatosend"
41 </command>
42 </client>
43
44 #
45 # Verify data after the test has been "shot"
46 <verify>
47 <strip>
48 ^User-Agent:.*
49 ^X-Forwarded-Proto:.*
50 ^Via:.*
51 </strip>
52 <protocol nonewline="yes">
53 POST /1701 HTTP/1.1\r
54 Host: %HOSTIP:%HTTP2PORT\r
55 Accept: */*\r
56 Content-Length: 10\r
57 Content-Type: application/x-www-form-urlencoded\r
58 \r
59 datatosend
60 </protocol>
61 <stdout>
62 HTTP/1.1 101 Switching Protocols\r
63 Connection: Upgrade\r
64 Upgrade: h2c\r
65 \r
66 HTTP/2 200 \r
67 date: Thu, 09 Nov 2010 14:49:00 GMT\r
68 last-modified: Tue, 13 Jun 2000 12:10:00 GMT\r
69 etag: "21025-dc7-39462498"\r
70 accept-ranges: bytes\r
71 content-length: 6\r
72 content-type: text/html\r
73 funny-head: yesyes\r
74 server: cut-out\r
75 via: 1.1 nghttpx\r
76 \r
77 -foo-
78 </stdout>
79 <stripfile>
80 s/^server:.*/server: cut-out\r/
81 </stripfile>
82 </verify>
83 </testcase>