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