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