• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<testcase>
2<info>
3<keywords>
4HTTP
5HTTP FORMPOST
6</keywords>
7</info>
8# Server-side
9<reply>
10<data>
11HTTP/1.1 200 OK
12Date: Tue, 09 Nov 2010 14:49:00 GMT
13Server: test-server/fake
14Content-Length: 10
15
16blablabla
17</data>
18</reply>
19
20# Client-side
21<client>
22<features>
23Mime
24</features>
25<server>
26http
27</server>
28<name>
29Multipart formposting with backslash-escaping filename containing '"'
30</name>
31<command>
32http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER --form-escape -F "file=@\"%LOGDIR/test%TESTNUMBER\\\".txt\";type=mo/foo;filename=\"test%TESTNUMBER\\\".txt\"" -F 'file2=@"%LOGDIR/test%TESTNUMBER\".txt"' -F 'file3=@"%LOGDIR/test%TESTNUMBER\".txt";type=m/f,"%LOGDIR/test%TESTNUMBER\".txt"'
33</command>
34<precheck>
35perl -e "print 'Test requires a system supporting double quotes in file names' if ($^O eq 'msys');"
36</precheck>
37# We create this file before the command is invoked!
38<file name=%LOGDIR/test%TESTNUMBER".txt>
39foo bar
40This is a bar foo
41bar
42foo
43</file>
44</client>
45
46# Verify data after the test has been "shot"
47<verify>
48<strip>
49^(Content-Type: multipart/form-data;|Content-Type: multipart/mixed; boundary=|-------).*
50</strip>
51<protocol>
52POST /we/want/%TESTNUMBER HTTP/1.1
53Host: %HOSTIP:%HTTPPORT
54User-Agent: curl/%VERSION
55Accept: */*
56Content-Length: 1002
57Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32
58
59------------------------------24e78000bd32
60Content-Disposition: form-data; name="file"; filename="test%TESTNUMBER\".txt"
61Content-Type: mo/foo
62
63foo bar
64This is a bar foo
65bar
66foo
67
68------------------------------24e78000bd32
69Content-Disposition: form-data; name="file2"; filename="test%TESTNUMBER\".txt"
70Content-Type: text/plain
71
72foo bar
73This is a bar foo
74bar
75foo
76
77------------------------------24e78000bd32
78Content-Disposition: form-data; name="file3"
79Content-Type: multipart/mixed; boundary=----------------------------7f0e85a48b0b
80
81Content-Disposition: attachment; filename="test%TESTNUMBER\".txt"
82Content-Type: m/f
83
84foo bar
85This is a bar foo
86bar
87foo
88
89Content-Disposition: attachment; filename="test%TESTNUMBER\".txt"
90Content-Type: text/plain
91
92foo bar
93This is a bar foo
94bar
95foo
96
97
98------------------------------24e78000bd32--
99</protocol>
100</verify>
101</testcase>
102