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