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: Tue, 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: Tue, 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: Tue, 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<features> 42Mime 43</features> 44<server> 45http 46</server> 47# tool is what to use instead of 'curl' 48<tool> 49lib%TESTNUMBER 50</tool> 51 52 <name> 53HTTP multi-part formpost using read callback for the file part 54 </name> 55 <command> 56http://%HOSTIP:%HTTPPORT/%TESTNUMBER 57</command> 58</client> 59 60# 61# Verify data after the test has been "shot" 62<verify> 63<strippart> 64s/^--------------------------[a-z0-9]*/------------------------------/ 65s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/ 66</strippart> 67# Note that the stripping above removes 12 bytes from every occurrence of the 68# boundary string and since 5 of them are in the body contents, we see 69# (5*12) == 60 bytes less 70<protocol> 71POST /%TESTNUMBER HTTP/1.1 72Host: %HOSTIP:%HTTPPORT 73Accept: */* 74Content-Length: 744 75Content-Type: multipart/form-data; boundary=---------------------------- 76 77------------------------------ 78Content-Disposition: form-data; name="sendfile"; filename="postit2.c" 79 80this is what we post to the silly web server 81 82------------------------------ 83Content-Disposition: form-data; name="callbackdata" 84 85this is what we post to the silly web server 86 87------------------------------ 88Content-Disposition: form-data; name="filename" 89 90postit2.c 91------------------------------ 92Content-Disposition: form-data; name="submit" 93Content-Type: text/plain 94 95send 96------------------------------ 97Content-Disposition: form-data; name="somename"; filename="somefile.txt" 98Content-Type: text/plain 99 100blah blah 101-------------------------------- 102POST /%TESTNUMBER HTTP/1.1 103Host: %HOSTIP:%HTTPPORT 104Accept: */* 105Content-Length: 758 106Content-Type: multipart/form-data; boundary=---------------------------- 107 108------------------------------ 109Content-Disposition: form-data; name="sendfile alternative"; filename="file name 2" 110 111this is what we post to the silly web server 112 113------------------------------ 114Content-Disposition: form-data; name="callbackdata" 115 116this is what we post to the silly web server 117 118------------------------------ 119Content-Disposition: form-data; name="filename" 120 121postit2.c 122------------------------------ 123Content-Disposition: form-data; name="submit" 124Content-Type: text/plain 125 126send 127------------------------------ 128Content-Disposition: form-data; name="somename"; filename="somefile.txt" 129Content-Type: text/plain 130 131blah blah 132-------------------------------- 133</protocol> 134</verify> 135</testcase> 136