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