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> 14*6236dae4SAndroid Build Coastguard WorkerHTTP/1.1 200 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 Worker 20*6236dae4SAndroid Build Coastguard Workerhello 21*6236dae4SAndroid Build Coastguard Worker</data> 22*6236dae4SAndroid Build Coastguard Worker<datacheck> 23*6236dae4SAndroid Build Coastguard WorkerHTTP/1.1 200 OK 24*6236dae4SAndroid Build Coastguard WorkerDate: Tue, 09 Nov 2010 14:49:00 GMT 25*6236dae4SAndroid Build Coastguard WorkerServer: test-server/fake swsclose 26*6236dae4SAndroid Build Coastguard WorkerConnection: close 27*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/html 28*6236dae4SAndroid Build Coastguard Worker 29*6236dae4SAndroid Build Coastguard Workerhello 30*6236dae4SAndroid Build Coastguard WorkerHTTP/1.1 200 OK 31*6236dae4SAndroid Build Coastguard WorkerDate: Tue, 09 Nov 2010 14:49:00 GMT 32*6236dae4SAndroid Build Coastguard WorkerServer: test-server/fake swsclose 33*6236dae4SAndroid Build Coastguard WorkerConnection: close 34*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/html 35*6236dae4SAndroid Build Coastguard Worker 36*6236dae4SAndroid Build Coastguard Workerhello 37*6236dae4SAndroid Build Coastguard Worker</datacheck> 38*6236dae4SAndroid Build Coastguard Worker</reply> 39*6236dae4SAndroid Build Coastguard Worker 40*6236dae4SAndroid Build Coastguard Worker# Client-side 41*6236dae4SAndroid Build Coastguard Worker<client> 42*6236dae4SAndroid Build Coastguard Worker<features> 43*6236dae4SAndroid Build Coastguard Workerform-api 44*6236dae4SAndroid Build Coastguard Worker</features> 45*6236dae4SAndroid Build Coastguard Worker<server> 46*6236dae4SAndroid Build Coastguard Workerhttp 47*6236dae4SAndroid Build Coastguard Worker</server> 48*6236dae4SAndroid Build Coastguard Worker# tool is what to use instead of 'curl' 49*6236dae4SAndroid Build Coastguard Worker<tool> 50*6236dae4SAndroid Build Coastguard Workerlib%TESTNUMBER 51*6236dae4SAndroid Build Coastguard Worker</tool> 52*6236dae4SAndroid Build Coastguard Worker 53*6236dae4SAndroid Build Coastguard Worker<name> 54*6236dae4SAndroid Build Coastguard WorkerHTTP multi-part formpost using read callback for the file part 55*6236dae4SAndroid Build Coastguard Worker</name> 56*6236dae4SAndroid Build Coastguard Worker<command> 57*6236dae4SAndroid Build Coastguard Workerhttp://%HOSTIP:%HTTPPORT/%TESTNUMBER 58*6236dae4SAndroid Build Coastguard Worker</command> 59*6236dae4SAndroid Build Coastguard Worker</client> 60*6236dae4SAndroid Build Coastguard Worker 61*6236dae4SAndroid Build Coastguard Worker# 62*6236dae4SAndroid Build Coastguard Worker# Verify data after the test has been "shot" 63*6236dae4SAndroid Build Coastguard Worker<verify> 64*6236dae4SAndroid Build Coastguard Worker<strippart> 65*6236dae4SAndroid Build Coastguard Workers/^--------------------------[A-Za-z0-9]*/------------------------------/ 66*6236dae4SAndroid Build Coastguard Workers/boundary=------------------------[A-Za-z0-9]*/boundary=----------------------------/ 67*6236dae4SAndroid Build Coastguard Worker</strippart> 68*6236dae4SAndroid Build Coastguard Worker# Note that the stripping above removes 12 bytes from every occurrence of the 69*6236dae4SAndroid Build Coastguard Worker# boundary string and since 5 of them are in the body contents, we see 70*6236dae4SAndroid Build Coastguard Worker# (5*12) == 60 bytes less 71*6236dae4SAndroid Build Coastguard Worker<protocol> 72*6236dae4SAndroid Build Coastguard WorkerPOST /%TESTNUMBER HTTP/1.1 73*6236dae4SAndroid Build Coastguard WorkerHost: %HOSTIP:%HTTPPORT 74*6236dae4SAndroid Build Coastguard WorkerAccept: */* 75*6236dae4SAndroid Build Coastguard WorkerContent-Length: 780 76*6236dae4SAndroid Build Coastguard WorkerContent-Type: multipart/form-data; boundary=---------------------------- 77*6236dae4SAndroid Build Coastguard Worker 78*6236dae4SAndroid Build Coastguard Worker------------------------------ 79*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="sendfile"; filename="postit2.c" 80*6236dae4SAndroid Build Coastguard Worker 81*6236dae4SAndroid Build Coastguard Workerthis is what we post to the silly web server 82*6236dae4SAndroid Build Coastguard Worker 83*6236dae4SAndroid Build Coastguard Worker------------------------------ 84*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="callbackdata" 85*6236dae4SAndroid Build Coastguard Worker 86*6236dae4SAndroid Build Coastguard Workerthis is what we post to the silly web server 87*6236dae4SAndroid Build Coastguard Worker 88*6236dae4SAndroid Build Coastguard Worker------------------------------ 89*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="filename" 90*6236dae4SAndroid Build Coastguard Worker 91*6236dae4SAndroid Build Coastguard Workerpostit2.c 92*6236dae4SAndroid Build Coastguard Worker------------------------------ 93*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="submit" 94*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/plain 95*6236dae4SAndroid Build Coastguard Worker 96*6236dae4SAndroid Build Coastguard Workersend 97*6236dae4SAndroid Build Coastguard Worker------------------------------ 98*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="somename"; filename="somefile.txt" 99*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/plain 100*6236dae4SAndroid Build Coastguard Worker 101*6236dae4SAndroid Build Coastguard Workerblah blah 102*6236dae4SAndroid Build Coastguard Worker-------------------------------- 103*6236dae4SAndroid Build Coastguard WorkerPOST /%TESTNUMBER HTTP/1.1 104*6236dae4SAndroid Build Coastguard WorkerHost: %HOSTIP:%HTTPPORT 105*6236dae4SAndroid Build Coastguard WorkerAccept: */* 106*6236dae4SAndroid Build Coastguard WorkerContent-Length: 794 107*6236dae4SAndroid Build Coastguard WorkerContent-Type: multipart/form-data; boundary=---------------------------- 108*6236dae4SAndroid Build Coastguard Worker 109*6236dae4SAndroid Build Coastguard Worker------------------------------ 110*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="sendfile alternative"; filename="file name 2" 111*6236dae4SAndroid Build Coastguard Worker 112*6236dae4SAndroid Build Coastguard Workerthis is what we post to the silly web server 113*6236dae4SAndroid Build Coastguard Worker 114*6236dae4SAndroid Build Coastguard Worker------------------------------ 115*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="callbackdata" 116*6236dae4SAndroid Build Coastguard Worker 117*6236dae4SAndroid Build Coastguard Workerthis is what we post to the silly web server 118*6236dae4SAndroid Build Coastguard Worker 119*6236dae4SAndroid Build Coastguard Worker------------------------------ 120*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="filename" 121*6236dae4SAndroid Build Coastguard Worker 122*6236dae4SAndroid Build Coastguard Workerpostit2.c 123*6236dae4SAndroid Build Coastguard Worker------------------------------ 124*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="submit" 125*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/plain 126*6236dae4SAndroid Build Coastguard Worker 127*6236dae4SAndroid Build Coastguard Workersend 128*6236dae4SAndroid Build Coastguard Worker------------------------------ 129*6236dae4SAndroid Build Coastguard WorkerContent-Disposition: form-data; name="somename"; filename="somefile.txt" 130*6236dae4SAndroid Build Coastguard WorkerContent-Type: text/plain 131*6236dae4SAndroid Build Coastguard Worker 132*6236dae4SAndroid Build Coastguard Workerblah blah 133*6236dae4SAndroid Build Coastguard Worker-------------------------------- 134*6236dae4SAndroid Build Coastguard Worker</protocol> 135*6236dae4SAndroid Build Coastguard Worker</verify> 136*6236dae4SAndroid Build Coastguard Worker</testcase> 137