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<datacheck> 22HTTP/1.1 200 OK 23Date: Thu, 09 Nov 2010 14:49:00 GMT 24Server: test-server/fake swsclose 25Connection: close 26Content-Type: text/html 27 28hello 29HTTP/1.1 200 OK 30Date: Thu, 09 Nov 2010 14:49:00 GMT 31Server: test-server/fake swsclose 32Connection: close 33Content-Type: text/html 34 35hello 36</datacheck> 37</reply> 38 39# Client-side 40<client> 41<server> 42http 43</server> 44# tool is what to use instead of 'curl' 45<tool> 46lib554 47</tool> 48 49 <name> 50HTTP multi-part formpost using read callback for the file part 51 </name> 52 <command> 53http://%HOSTIP:%HTTPPORT/554 54</command> 55</client> 56 57# 58# Verify data after the test has been "shot" 59<verify> 60<strippart> 61s/^--------------------------[a-z0-9]*/------------------------------/ 62s/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> 68POST /554 HTTP/1.1 69Host: %HOSTIP:%HTTPPORT 70Accept: */* 71Content-Length: 718 72Expect: 100-continue 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 /554 HTTP/1.1 100Host: %HOSTIP:%HTTPPORT 101Accept: */* 102Content-Length: 732 103Expect: 100-continue 104Content-Type: multipart/form-data; boundary=---------------------------- 105 106------------------------------ 107Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2" 108 109this is what we post to the silly web server 110 111------------------------------ 112Content-Disposition: form-data; name="callbackdata" 113 114this is what we post to the silly web server 115 116------------------------------ 117Content-Disposition: form-data; name="filename" 118 119postit2.c 120------------------------------ 121Content-Disposition: form-data; name="submit" 122 123send 124------------------------------ 125Content-Disposition: form-data; name="somename"; filename="somefile.txt" 126Content-Type: text/plain 127 128blah blah 129-------------------------------- 130</protocol> 131</verify> 132</testcase> 133