1*6236dae4SAndroid Build Coastguard Worker<testcase> 2*6236dae4SAndroid Build Coastguard Worker<info> 3*6236dae4SAndroid Build Coastguard Worker<keywords> 4*6236dae4SAndroid Build Coastguard WorkerHTTP 5*6236dae4SAndroid Build Coastguard WorkerHTTP POST 6*6236dae4SAndroid Build Coastguard WorkerFORM 7*6236dae4SAndroid Build Coastguard Worker</keywords> 8*6236dae4SAndroid Build Coastguard Worker</info> 9*6236dae4SAndroid Build Coastguard Worker 10*6236dae4SAndroid Build Coastguard Worker# 11*6236dae4SAndroid Build Coastguard Worker# Server-side 12*6236dae4SAndroid Build Coastguard Worker<reply> 13*6236dae4SAndroid Build Coastguard Worker<data nocheck="yes"> 14*6236dae4SAndroid Build Coastguard WorkerHTTP/1.1 301 OK 15*6236dae4SAndroid Build Coastguard WorkerDate: Tue, 09 Nov 2010 14:49:00 GMT 16*6236dae4SAndroid Build Coastguard WorkerServer: test-server/fake swsclose 17*6236dae4SAndroid Build Coastguard WorkerConnection: close 18*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/html 19*6236dae4SAndroid Build Coastguard WorkerLocation: /%TESTNUMBER0002 20*6236dae4SAndroid Build Coastguard Worker 21*6236dae4SAndroid Build Coastguard Workerhello 22*6236dae4SAndroid Build Coastguard Worker</data> 23*6236dae4SAndroid Build Coastguard Worker<data2 crlf="yes"> 24*6236dae4SAndroid Build Coastguard WorkerHTTP/1.1 200 OK 25*6236dae4SAndroid Build Coastguard WorkerDate: Tue, 09 Nov 2010 14:49:00 GMT 26*6236dae4SAndroid Build Coastguard WorkerServer: test-server/fake 27*6236dae4SAndroid Build Coastguard WorkerContent-Length: 6 28*6236dae4SAndroid Build Coastguard WorkerConnection: close 29*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/html 30*6236dae4SAndroid Build Coastguard Worker 31*6236dae4SAndroid Build Coastguard Worker-foo- 32*6236dae4SAndroid Build Coastguard Worker</data2> 33*6236dae4SAndroid Build Coastguard Worker</reply> 34*6236dae4SAndroid Build Coastguard Worker 35*6236dae4SAndroid Build Coastguard Worker# Client-side 36*6236dae4SAndroid Build Coastguard Worker<client> 37*6236dae4SAndroid Build Coastguard Worker<features> 38*6236dae4SAndroid Build Coastguard Workerform-api 39*6236dae4SAndroid Build Coastguard Worker</features> 40*6236dae4SAndroid Build Coastguard Worker<server> 41*6236dae4SAndroid Build Coastguard Workerhttp 42*6236dae4SAndroid Build Coastguard Worker</server> 43*6236dae4SAndroid Build Coastguard Worker# tool is what to use instead of 'curl' 44*6236dae4SAndroid Build Coastguard Worker<tool> 45*6236dae4SAndroid Build Coastguard Workerlib%TESTNUMBER 46*6236dae4SAndroid Build Coastguard Worker</tool> 47*6236dae4SAndroid Build Coastguard Worker 48*6236dae4SAndroid Build Coastguard Worker<name> 49*6236dae4SAndroid Build Coastguard WorkerHTTP formpost using form API - with redirect and re-POST 50*6236dae4SAndroid Build Coastguard Worker</name> 51*6236dae4SAndroid Build Coastguard Worker<stdin> 52*6236dae4SAndroid Build Coastguard Worker Some data from stdin 53*6236dae4SAndroid Build Coastguard Worker</stdin> 54*6236dae4SAndroid Build Coastguard Worker<command> 55*6236dae4SAndroid Build Coastguard Workerhttp://%HOSTIP:%HTTPPORT/%TESTNUMBER %LOGDIR/test%TESTNUMBER.filedata 56*6236dae4SAndroid Build Coastguard Worker</command> 57*6236dae4SAndroid Build Coastguard Worker<file name="%LOGDIR/test%TESTNUMBER.filedata"> 58*6236dae4SAndroid Build Coastguard WorkerThis is data from a file. 59*6236dae4SAndroid Build Coastguard Worker</file> 60*6236dae4SAndroid Build Coastguard Worker</client> 61*6236dae4SAndroid Build Coastguard Worker 62*6236dae4SAndroid Build Coastguard Worker# 63*6236dae4SAndroid Build Coastguard Worker# Verify data bbter the test has been "shot" 64*6236dae4SAndroid Build Coastguard Worker<verify> 65*6236dae4SAndroid Build Coastguard Worker<strippart> 66*6236dae4SAndroid Build Coastguard Workers/^--------------------------[A-Za-z0-9]*/------------------------------/ 67*6236dae4SAndroid Build Coastguard Workers/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ 68*6236dae4SAndroid Build Coastguard Worker</strippart> 69*6236dae4SAndroid Build Coastguard Worker# Note that the stripping above removes 12 bytes from every occurrence of the 70*6236dae4SAndroid Build Coastguard Worker# boundary string and since 5 of them are in the body contents, we see 71*6236dae4SAndroid Build Coastguard Worker# (5*12) == 60 bytes less 72*6236dae4SAndroid Build Coastguard Worker<protocol> 73*6236dae4SAndroid Build Coastguard WorkerPOST /%TESTNUMBER HTTP/1.1 74*6236dae4SAndroid Build Coastguard WorkerHost: %HOSTIP:%HTTPPORT 75*6236dae4SAndroid Build Coastguard WorkerAccept: */* 76*6236dae4SAndroid Build Coastguard WorkerTransfer-Encoding: chunked 77*6236dae4SAndroid Build Coastguard WorkerContent-Type: multipart/form-data; boundary=---------------------------- 78*6236dae4SAndroid Build Coastguard WorkerExpect: 100-continue 79*6236dae4SAndroid Build Coastguard Worker 80*6236dae4SAndroid Build Coastguard Worker385 81*6236dae4SAndroid Build Coastguard Worker------------------------------ 82*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="fieldname" 83*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/plain 84*6236dae4SAndroid Build Coastguard WorkerX-customheader-1: Header 1 data 85*6236dae4SAndroid Build Coastguard WorkerX-customheader-2: Header 2 data 86*6236dae4SAndroid Build Coastguard Worker 87*6236dae4SAndroid Build Coastguard Workerthis is what we post to the silly web server 88*6236dae4SAndroid Build Coastguard Worker------------------------------ 89*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="fieldnam" 90*6236dae4SAndroid Build Coastguard Worker 91*6236dae4SAndroid Build Coastguard Workeruhis is what we post to the silly web serve 92*6236dae4SAndroid Build Coastguard Worker------------------------------ 93*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="multifile" 94*6236dae4SAndroid Build Coastguard WorkerContent-Type: multipart/mixed; boundary=---------------------------- 95*6236dae4SAndroid Build Coastguard Worker 96*6236dae4SAndroid Build Coastguard Worker------------------------------ 97*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: attachment; filename="test%TESTNUMBER.filedata" 98*6236dae4SAndroid Build Coastguard WorkerContent-Type: application/octet-stream 99*6236dae4SAndroid Build Coastguard Worker 100*6236dae4SAndroid Build Coastguard WorkerThis is data from a file. 101*6236dae4SAndroid Build Coastguard Worker 102*6236dae4SAndroid Build Coastguard Worker------------------------------ 103*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: attachment; filename="test%TESTNUMBER.filedata" 104*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/whatever 105*6236dae4SAndroid Build Coastguard Worker 106*6236dae4SAndroid Build Coastguard Worker 107*6236dae4SAndroid Build Coastguard Worker%if hyper 108*6236dae4SAndroid Build Coastguard WorkerAB 109*6236dae4SAndroid Build Coastguard Worker%else 110*6236dae4SAndroid Build Coastguard Workerab 111*6236dae4SAndroid Build Coastguard Worker%endif 112*6236dae4SAndroid Build Coastguard WorkerThis is data from a file. 113*6236dae4SAndroid Build Coastguard Worker 114*6236dae4SAndroid Build Coastguard Worker------------------------------ 115*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: attachment; filename="test%TESTNUMBER.filedata" 116*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/whatever 117*6236dae4SAndroid Build Coastguard Worker 118*6236dae4SAndroid Build Coastguard Worker 119*6236dae4SAndroid Build Coastguard Worker%if hyper 120*6236dae4SAndroid Build Coastguard WorkerBB 121*6236dae4SAndroid Build Coastguard Worker%else 122*6236dae4SAndroid Build Coastguard Workerbb 123*6236dae4SAndroid Build Coastguard Worker%endif 124*6236dae4SAndroid Build Coastguard WorkerThis is data from a file. 125*6236dae4SAndroid Build Coastguard Worker 126*6236dae4SAndroid Build Coastguard Worker-------------------------------- 127*6236dae4SAndroid Build Coastguard Worker 128*6236dae4SAndroid Build Coastguard Worker------------------------------ 129*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="filecontents" 130*6236dae4SAndroid Build Coastguard Worker 131*6236dae4SAndroid Build Coastguard Worker 132*6236dae4SAndroid Build Coastguard Worker%if hyper 133*6236dae4SAndroid Build Coastguard Worker11B 134*6236dae4SAndroid Build Coastguard Worker%else 135*6236dae4SAndroid Build Coastguard Worker11b 136*6236dae4SAndroid Build Coastguard Worker%endif 137*6236dae4SAndroid Build Coastguard WorkerThis is data from a file. 138*6236dae4SAndroid Build Coastguard Worker 139*6236dae4SAndroid Build Coastguard Worker------------------------------ 140*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="formlength" 141*6236dae4SAndroid Build Coastguard Worker 142*6236dae4SAndroid Build Coastguard Worker1433 143*6236dae4SAndroid Build Coastguard Worker------------------------------ 144*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="standardinput" 145*6236dae4SAndroid Build Coastguard WorkerContent-Type: application/octet-stream 146*6236dae4SAndroid Build Coastguard Worker 147*6236dae4SAndroid Build Coastguard Worker 148*6236dae4SAndroid Build Coastguard Worker16 149*6236dae4SAndroid Build Coastguard Worker Some data from stdin 150*6236dae4SAndroid Build Coastguard Worker 151*6236dae4SAndroid Build Coastguard Worker36 152*6236dae4SAndroid Build Coastguard Worker 153*6236dae4SAndroid Build Coastguard Worker-------------------------------- 154*6236dae4SAndroid Build Coastguard Worker 155*6236dae4SAndroid Build Coastguard Worker0 156*6236dae4SAndroid Build Coastguard Worker 157*6236dae4SAndroid Build Coastguard WorkerPOST /%TESTNUMBER0002 HTTP/1.1 158*6236dae4SAndroid Build Coastguard WorkerHost: %HOSTIP:%HTTPPORT 159*6236dae4SAndroid Build Coastguard WorkerAccept: */* 160*6236dae4SAndroid Build Coastguard WorkerTransfer-Encoding: chunked 161*6236dae4SAndroid Build Coastguard WorkerContent-Type: multipart/form-data; boundary=---------------------------- 162*6236dae4SAndroid Build Coastguard WorkerExpect: 100-continue 163*6236dae4SAndroid Build Coastguard Worker 164*6236dae4SAndroid Build Coastguard Worker385 165*6236dae4SAndroid Build Coastguard Worker------------------------------ 166*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="fieldname" 167*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/plain 168*6236dae4SAndroid Build Coastguard WorkerX-customheader-1: Header 1 data 169*6236dae4SAndroid Build Coastguard WorkerX-customheader-2: Header 2 data 170*6236dae4SAndroid Build Coastguard Worker 171*6236dae4SAndroid Build Coastguard Workerthis is what we post to the silly web server 172*6236dae4SAndroid Build Coastguard Worker------------------------------ 173*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="fieldnam" 174*6236dae4SAndroid Build Coastguard Worker 175*6236dae4SAndroid Build Coastguard Workeruhis is what we post to the silly web serve 176*6236dae4SAndroid Build Coastguard Worker------------------------------ 177*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="multifile" 178*6236dae4SAndroid Build Coastguard WorkerContent-Type: multipart/mixed; boundary=---------------------------- 179*6236dae4SAndroid Build Coastguard Worker 180*6236dae4SAndroid Build Coastguard Worker------------------------------ 181*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: attachment; filename="test%TESTNUMBER.filedata" 182*6236dae4SAndroid Build Coastguard WorkerContent-Type: application/octet-stream 183*6236dae4SAndroid Build Coastguard Worker 184*6236dae4SAndroid Build Coastguard WorkerThis is data from a file. 185*6236dae4SAndroid Build Coastguard Worker 186*6236dae4SAndroid Build Coastguard Worker------------------------------ 187*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: attachment; filename="test%TESTNUMBER.filedata" 188*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/whatever 189*6236dae4SAndroid Build Coastguard Worker 190*6236dae4SAndroid Build Coastguard Worker 191*6236dae4SAndroid Build Coastguard Worker%if hyper 192*6236dae4SAndroid Build Coastguard WorkerAB 193*6236dae4SAndroid Build Coastguard Worker%else 194*6236dae4SAndroid Build Coastguard Workerab 195*6236dae4SAndroid Build Coastguard Worker%endif 196*6236dae4SAndroid Build Coastguard WorkerThis is data from a file. 197*6236dae4SAndroid Build Coastguard Worker 198*6236dae4SAndroid Build Coastguard Worker------------------------------ 199*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: attachment; filename="test%TESTNUMBER.filedata" 200*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/whatever 201*6236dae4SAndroid Build Coastguard Worker 202*6236dae4SAndroid Build Coastguard Worker 203*6236dae4SAndroid Build Coastguard Worker%if hyper 204*6236dae4SAndroid Build Coastguard WorkerBB 205*6236dae4SAndroid Build Coastguard Worker%else 206*6236dae4SAndroid Build Coastguard Workerbb 207*6236dae4SAndroid Build Coastguard Worker%endif 208*6236dae4SAndroid Build Coastguard WorkerThis is data from a file. 209*6236dae4SAndroid Build Coastguard Worker 210*6236dae4SAndroid Build Coastguard Worker-------------------------------- 211*6236dae4SAndroid Build Coastguard Worker 212*6236dae4SAndroid Build Coastguard Worker------------------------------ 213*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="filecontents" 214*6236dae4SAndroid Build Coastguard Worker 215*6236dae4SAndroid Build Coastguard Worker 216*6236dae4SAndroid Build Coastguard Worker%if hyper 217*6236dae4SAndroid Build Coastguard Worker11B 218*6236dae4SAndroid Build Coastguard Worker%else 219*6236dae4SAndroid Build Coastguard Worker11b 220*6236dae4SAndroid Build Coastguard Worker%endif 221*6236dae4SAndroid Build Coastguard WorkerThis is data from a file. 222*6236dae4SAndroid Build Coastguard Worker 223*6236dae4SAndroid Build Coastguard Worker------------------------------ 224*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="formlength" 225*6236dae4SAndroid Build Coastguard Worker 226*6236dae4SAndroid Build Coastguard Worker1433 227*6236dae4SAndroid Build Coastguard Worker------------------------------ 228*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="standardinput" 229*6236dae4SAndroid Build Coastguard WorkerContent-Type: application/octet-stream 230*6236dae4SAndroid Build Coastguard Worker 231*6236dae4SAndroid Build Coastguard Worker 232*6236dae4SAndroid Build Coastguard Worker16 233*6236dae4SAndroid Build Coastguard Worker Some data from stdin 234*6236dae4SAndroid Build Coastguard Worker 235*6236dae4SAndroid Build Coastguard Worker36 236*6236dae4SAndroid Build Coastguard Worker 237*6236dae4SAndroid Build Coastguard Worker-------------------------------- 238*6236dae4SAndroid Build Coastguard Worker 239*6236dae4SAndroid Build Coastguard Worker0 240*6236dae4SAndroid Build Coastguard Worker 241*6236dae4SAndroid Build Coastguard Worker</protocol> 242*6236dae4SAndroid Build Coastguard Worker</verify> 243*6236dae4SAndroid Build Coastguard Worker</testcase> 244