test1315 (1872B)
1 <testcase> 2 # Based on tests 186 and 1053 3 <info> 4 <keywords> 5 HTTP 6 HTTP FORMPOST 7 HTTP file upload 8 </keywords> 9 </info> 10 11 # Server-side 12 <reply> 13 <data> 14 HTTP/1.1 200 OK 15 Date: Thu, 29 Jul 2008 14:49:00 GMT 16 Server: test-server/fake 17 Content-Length: 0 18 Connection: close 19 20 </data> 21 </reply> 22 23 # Client-side 24 <client> 25 <features> 26 Mime 27 </features> 28 <server> 29 http 30 </server> 31 <name> 32 HTTP RFC1867-type formposting - -F with three files, one with explicit type 33 </name> 34 <command> 35 http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F name=value -F 'file=@%LOGDIR/test%TESTNUMBER.txt,%LOGDIR/test%TESTNUMBER.txt;type=magic/content,%LOGDIR/test%TESTNUMBER.txt' 36 </command> 37 # We create this file before the command is invoked! 38 <file name="%LOGDIR/test%TESTNUMBER.txt"> 39 dummy data 40 </file> 41 </client> 42 43 # Verify data after the test has been "shot" 44 <verify> 45 <strip> 46 -----+\w+ 47 </strip> 48 <protocol> 49 POST /we/want/%TESTNUMBER HTTP/1.1 50 Host: %HOSTIP:%HTTPPORT 51 User-Agent: curl/%VERSION 52 Accept: */* 53 Content-Length: 845 54 Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763 55 56 ------------------------------9ef8d6205763 57 Content-Disposition: form-data; name="name" 58 59 value 60 ------------------------------9ef8d6205763 61 Content-Disposition: form-data; name="file" 62 Content-Type: multipart/mixed; boundary=----------------------------aaaaaaaaaaaa 63 64 Content-Disposition: attachment; filename="test%TESTNUMBER.txt" 65 Content-Type: text/plain 66 67 dummy data 68 69 ------------------------------9ef8d6205763 70 Content-Disposition: attachment; filename="test%TESTNUMBER.txt" 71 Content-Type: magic/content 72 73 dummy data 74 75 ------------------------------9ef8d6205763 76 Content-Disposition: attachment; filename="test%TESTNUMBER.txt" 77 Content-Type: text/plain 78 79 dummy data 80 81 ------------------------------aaaaaaaaaaaa-- 82 83 ------------------------------9ef8d6205763-- 84 </protocol> 85 </verify> 86 </testcase>