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: Tue, 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: Tue, 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: Tue, 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> 47lib%TESTNUMBER 48</tool> 49 50 <name> 51HTTP duplicate easy handle with mime data 52 </name> 53 <command> 54http://%HOSTIP:%HTTPPORT/%TESTNUMBER 55</command> 56<file name="log/file%TESTNUMBER.txt"> 57This is data from a file 58</file> 59</client> 60 61# 62# Verify data after the test has been "shot" 63<verify> 64<strippart> 65s/^--------------------------[a-z0-9]*/------------------------------/ 66s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/ 67</strippart> 68# Note that the stripping above removes 12 bytes from every occurrence of the 69# boundary string and since 5 of them are in the body contents, we see 70# (5*12) == 60 bytes less 71<protocol> 72POST /%TESTNUMBER HTTP/1.1 73Host: %HOSTIP:%HTTPPORT 74Accept: */* 75Content-Length: 0 76 77POST /%TESTNUMBER HTTP/1.1 78Host: %HOSTIP:%HTTPPORT 79Accept: */* 80Transfer-Encoding: chunked 81Content-Type: multipart/form-data; boundary=---------------------------- 82Expect: 100-continue 83 84%if hyper 851AF 86%else 871af 88%endif 89------------------------------ 90Content-Disposition: form-data; name="greeting" 91Content-Type: application/X-Greeting 92Content-Transfer-Encoding: base64 93X-Test-Number: %TESTNUMBER 94 95aGVsbG8= 96------------------------------ 97Content-Disposition: form-data; filename="file%TESTNUMBER.txt" 98Content-Type: text/plain 99 100This is data from a file 101 102------------------------------ 103Content-Disposition: form-data 104 105 1061 107d 1081 109u 1101 111m 1121 113m 1141 115y 1161 117 118 11930 120 121-------------------------------- 122 1230 124 125</protocol> 126</verify> 127</testcase> 128