b08d7741f7f5b86557ce0f605ba337dbb6edb291
[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 mode="text">
13 HTTP/1.1 200 OK
14 Date: Thu, 09 Nov 2010 14:49:00 GMT
15 Server: test-server/fake swsclose
16 Connection: close
17 Content-Type: text/html
18
19 hello
20 </data>
21 </reply>
22
23 # Client-side
24 <client>
25 <server>
26 http
27 </server>
28 # tool is what to use instead of 'curl'
29 <tool>
30 lib554
31 </tool>
32
33  <name>
34 HTTP multi-part formpost using read callback for the file part
35  </name>
36  <command>
37 http://%HOSTIP:%HTTPPORT/554
38 </command>
39 </client>
40
41 #
42 # Verify data after the test has been "shot"
43 <verify>
44 <strippart>
45 s/^--------------------------[a-z0-9]*/------------------------------/
46 s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/
47 </strippart>
48 # Note that the stripping above removes 12 bytes from every occurance of the
49 # boundary string and since 5 of them are in the body contents, we see
50 # (5*12) == 60 bytes less
51 <protocol>
52 POST /554 HTTP/1.1\r
53 Host: %HOSTIP:%HTTPPORT\r
54 Accept: */*\r
55 Content-Length: 718\r
56 Expect: 100-continue\r
57 Content-Type: multipart/form-data; boundary=----------------------------\r
58 \r
59 ------------------------------\r
60 Content-Disposition: form-data; name="sendfile"; filename="postit2.c"\r
61 \r
62 this is what we post to the silly web server
63 \r
64 ------------------------------\r
65 Content-Disposition: form-data; name="callbackdata"\r
66 \r
67 this is what we post to the silly web server
68 \r
69 ------------------------------\r
70 Content-Disposition: form-data; name="filename"\r
71 \r
72 postit2.c\r
73 ------------------------------\r
74 Content-Disposition: form-data; name="submit"\r
75 \r
76 send\r
77 ------------------------------\r
78 Content-Disposition: form-data; name="somename"; filename="somefile.txt"\r
79 Content-Type: text/plain\r
80 \r
81 blah blah\r
82 --------------------------------\r
83 </protocol>
84 </verify>
85 </testcase>