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 30</datacheck> 31</reply> 32 33# Client-side 34<client> 35<server> 36http 37</server> 38# tool is what to use instead of 'curl' 39<tool> 40lib%TESTNUMBER 41</tool> 42 43 <name> 44HTTP mimepost early end of data detection 45 </name> 46 <command> 47http://%HOSTIP:%HTTPPORT/%TESTNUMBER 48</command> 49<file name="log/file%TESTNUMBER.txt"> 50This is data from a file 51</file> 52</client> 53 54# 55# Verify data after the test has been "shot" 56<verify> 57<strippart> 58s/^--------------------------[a-z0-9]*/------------------------------/ 59s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/ 60</strippart> 61# Note that the stripping above removes 12 bytes from every occurrence of the 62# boundary string and since 5 of them are in the body contents, we see 63# (5*12) == 60 bytes less 64<protocol> 65POST /%TESTNUMBER HTTP/1.1 66Host: %HOSTIP:%HTTPPORT 67Accept: */* 68Transfer-Encoding: chunked 69Content-Type: multipart/form-data; boundary=---------------------------- 70Expect: 100-continue 71 72%if hyper 73C1 74%else 75c1 76%endif 77------------------------------ 78Content-Disposition: form-data; name="field1" 79 80dummy 81------------------------------ 82Content-Disposition: form-data; name="field2" 83 84 855 86dummy 8791 88 89------------------------------ 90Content-Disposition: form-data; name="field3"; filename="file%TESTNUMBER.txt" 91Content-Type: text/plain 92 93 9449 95This is data from a file 96 97-------------------------------- 98 990 100 101</protocol> 102</verify> 103</testcase> 104