chiark / gitweb /
Import curl_7.56.1.orig.tar.gz
[curl.git] / tests / data / test645
1 <testcase>
2 <info>
3 <keywords>
4 HTTP
5 HTTP POST
6 HTTP MIME POST
7 </keywords>
8 </info>
9
10 #
11 # Server-side
12 <reply>
13 <data>
14 HTTP/1.1 200 OK\r
15 Date: Thu, 09 Nov 2010 14:49:00 GMT\r
16 Server: test-server/fake swsclose\r
17 Connection: close\r
18 Content-Type: text/html\r
19 \r
20 hello
21 </data>
22 <datacheck>
23 HTTP/1.1 200 OK\r
24 Date: Thu, 09 Nov 2010 14:49:00 GMT\r
25 Server: test-server/fake swsclose\r
26 Connection: close\r
27 Content-Type: text/html\r
28 \r
29 hello
30 HTTP/1.1 200 OK\r
31 Date: Thu, 09 Nov 2010 14:49:00 GMT\r
32 Server: test-server/fake swsclose\r
33 Connection: close\r
34 Content-Type: text/html\r
35 \r
36 hello
37 </datacheck>
38 </reply>
39
40 # Client-side
41 <client>
42 <server>
43 http
44 </server>
45 # tool is what to use instead of 'curl'
46 <tool>
47 lib645
48 </tool>
49
50  <name>
51 HTTP multi-part chunked mimepost using read callback for the file part
52  </name>
53  <command>
54 http://%HOSTIP:%HTTPPORT/645
55 </command>
56 </client>
57
58 #
59 # Verify data after the test has been "shot"
60 <verify>
61 <strippart>
62 s/^--------------------------[a-z0-9]*/------------------------------/
63 s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/
64 </strippart>
65 # Note that the stripping above removes 12 bytes from every occurrence of the
66 # boundary string and since 5 of them are in the body contents, we see
67 # (5*12) == 60 bytes less
68 <protocol>
69 POST /645 HTTP/1.1\r
70 Host: %HOSTIP:%HTTPPORT\r
71 Accept: */*\r
72 Transfer-Encoding: chunked\r
73 Content-Type: multipart/form-data; boundary=----------------------------\r
74 Expect: 100-continue\r
75 \r
76 2ce\r
77 ------------------------------\r
78 Content-Disposition: form-data; name="sendfile"; filename="postit2.c"\r
79 \r
80 this is what we post to the silly web server
81 \r
82 ------------------------------\r
83 Content-Disposition: form-data; name="callbackdata"\r
84 \r
85 this is what we post to the silly web server
86 \r
87 ------------------------------\r
88 Content-Disposition: form-data; name="filename"\r
89 \r
90 postit2.c\r
91 ------------------------------\r
92 Content-Disposition: form-data; name="submit"\r
93 \r
94 send\r
95 ------------------------------\r
96 Content-Disposition: form-data; name="somename"; filename="somefile.txt"\r
97 Content-Type: text/plain\r
98 \r
99 blah blah\r
100 --------------------------------\r
101 \r
102 0\r
103 \r
104 POST /645 HTTP/1.1\r
105 Host: %HOSTIP:%HTTPPORT\r
106 Accept: */*\r
107 Transfer-Encoding: chunked\r
108 Content-Type: multipart/form-data; boundary=----------------------------\r
109 Expect: 100-continue\r
110 \r
111 2dc\r
112 ------------------------------\r
113 Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2"\r
114 \r
115 this is what we post to the silly web server
116 \r
117 ------------------------------\r
118 Content-Disposition: form-data; name="callbackdata"\r
119 \r
120 this is what we post to the silly web server
121 \r
122 ------------------------------\r
123 Content-Disposition: form-data; name="filename"\r
124 \r
125 postit2.c\r
126 ------------------------------\r
127 Content-Disposition: form-data; name="submit"\r
128 \r
129 send\r
130 ------------------------------\r
131 Content-Disposition: form-data; name="somename"; filename="somefile.txt"\r
132 Content-Type: text/plain\r
133 \r
134 blah blah\r
135 --------------------------------\r
136 \r
137 0\r
138 \r
139 </protocol>
140 </verify>
141 </testcase>