Home | History | Annotate | Download | only in data
      1 <testcase>
      2 <info>
      3 <keywords>
      4 HTTP
      5 HTTP FORMPOST
      6 </keywords>
      7 </info>
      8 # Server-side
      9 <reply>
     10 <data>
     11 HTTP/1.1 200 OK
     12 Date: Thu, 09 Nov 2010 14:49:00 GMT
     13 Server: test-server/fake
     14 Content-Length: 10
     15 
     16 blablabla
     17 </data>
     18 </reply>
     19 
     20 # Client-side
     21 <client>
     22 <server>
     23 http
     24 </server>
     25  <name>
     26 HTTP RFC1867-type formposting with filename contains ',', ';', '"'
     27  </name>
     28  <command>
     29 http://%HOSTIP:%HTTPPORT/we/want/1133 -F "file=@\"log/test1133,a\\\"nd;.txt\";type=mo/foo;filename=\"faker,and;.txt\"" -F 'file2=@"log/test1133,a\"nd;.txt"' -F 'file3=@"log/test1133,a\"nd;.txt";type=m/f,"log/test1133,a\"nd;.txt"'
     30 </command>
     31 # We create this file before the command is invoked!
     32 <file name=log/test1133,a"nd;.txt>
     33 foo bar
     34 This is a bar foo
     35 bar
     36 foo
     37 </file>
     38 </client>
     39 
     40 # Verify data after the test has been "shot"
     41 <verify>
     42 <strip>
     43 ^(User-Agent:|Content-Type: multipart/form-data;|Content-Type: multipart/mixed; boundary=|-------).*
     44 </strip>
     45 <protocol>
     46 POST /we/want/1133 HTTP/1.1
     47 User-Agent: curl/7.10.4 (i686-pc-linux-gnu) libcurl/7.10.4 OpenSSL/0.9.7a ipv6 zlib/1.1.3
     48 Host: %HOSTIP:%HTTPPORT
     49 Accept: */*
     50 Content-Length: 967
     51 Expect: 100-continue
     52 Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32
     53 
     54 ------------------------------24e78000bd32
     55 Content-Disposition: form-data; name="file"; filename="faker,and;.txt"
     56 Content-Type: mo/foo
     57 
     58 foo bar
     59 This is a bar foo
     60 bar
     61 foo
     62 
     63 ------------------------------24e78000bd32
     64 Content-Disposition: form-data; name="file2"; filename="test1133,a\"nd;.txt"
     65 Content-Type: text/plain
     66 
     67 foo bar
     68 This is a bar foo
     69 bar
     70 foo
     71 
     72 ------------------------------24e78000bd32
     73 Content-Disposition: form-data; name="file3"
     74 Content-Type: multipart/mixed; boundary=----------------------------7f0e85a48b0b
     75 
     76 Content-Disposition: attachment; filename="test1133,a\"nd;.txt"
     77 Content-Type: m/f
     78 
     79 foo bar
     80 This is a bar foo
     81 bar
     82 foo
     83 
     84 Content-Disposition: attachment; filename="test1133,a\"nd;.txt"
     85 Content-Type: text/plain
     86 
     87 foo bar
     88 This is a bar foo
     89 bar
     90 foo
     91 
     92 ------------------------------24e78000bd32--
     93 </protocol>
     94 </verify>
     95 </testcase>
     96