Home | History | Annotate | Download | only in data
      1 <testcase>
      2 <info>
      3 <keywords>
      4 HTTP
      5 HTTP POST
      6 </keywords>
      7 </info>
      8 
      9 #
     10 # Server-side
     11 <reply>
     12 <data>
     13 HTTP/1.1 200 OK
     14 Date: Thu, 09 Nov 2010 14:49:00 GMT
     15 Server: test-server/fake swsclose
     16 Connection: close
     17 Content-Type: text/html
     18 
     19 hello
     20 </data>
     21 </reply>
     22 
     23 # Client-side
     24 <client>
     25 <server>
     26 http
     27 </server>
     28 # tool is what to use instead of 'curl'
     29 <tool>
     30 lib554
     31 </tool>
     32 
     33  <name>
     34 HTTP multi-part formpost using read callback for the file part
     35  </name>
     36  <command>
     37 http://%HOSTIP:%HTTPPORT/554
     38 </command>
     39 </client>
     40 
     41 #
     42 # Verify data after the test has been "shot"
     43 <verify>
     44 <strippart>
     45 s/^--------------------------[a-z0-9]*/------------------------------/
     46 s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/
     47 </strippart>
     48 # Note that the stripping above removes 12 bytes from every occurance of the
     49 # boundary string and since 5 of them are in the body contents, we see
     50 # (5*12) == 60 bytes less
     51 <protocol>
     52 POST /554 HTTP/1.1
     53 Host: %HOSTIP:%HTTPPORT
     54 Accept: */*
     55 Content-Length: 718
     56 Expect: 100-continue
     57 Content-Type: multipart/form-data; boundary=----------------------------
     58 
     59 ------------------------------
     60 Content-Disposition: form-data; name="sendfile"; filename="postit2.c"
     61 
     62 this is what we post to the silly web server
     63 
     64 ------------------------------
     65 Content-Disposition: form-data; name="callbackdata"
     66 
     67 this is what we post to the silly web server
     68 
     69 ------------------------------
     70 Content-Disposition: form-data; name="filename"
     71 
     72 postit2.c
     73 ------------------------------
     74 Content-Disposition: form-data; name="submit"
     75 
     76 send
     77 ------------------------------
     78 Content-Disposition: form-data; name="somename"; filename="somefile.txt"
     79 Content-Type: text/plain
     80 
     81 blah blah
     82 --------------------------------
     83 </protocol>
     84 </verify>
     85 </testcase>
     86