xref: /curl/tests/data/test39 (revision 3fd80c7b)
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>
29HTTP RFC1867-type formposting with filename= and type=
30</name>
31<command>
32http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F name=daniel -F tool=curl --form-string "str1=@literal" --form-string "str2=<verbatim;type=xxx/yyy" -F "file=@%LOGDIR/test%TESTNUMBER.txt;type=moo/foobar;filename=fakerfile" -F file2=@%LOGDIR/test%TESTNUMBER.txt -F "file3=@\"%LOGDIR/test%TESTNUMBER.txt\";type=mo/foo;filename=\"f\\\\\\\\ak\\\\\\er,\\\\an\\d;.t\\\"xt\"" -F 'file4=@"%LOGDIR/test%TESTNUMBER.txt"; filename="A\\AA\"\"\\\"ZZZ"'
33</command>
34# We create this file before the command is invoked!
35<file name="%LOGDIR/test%TESTNUMBER.txt">
36foo bar
37This is a bar foo
38bar
39foo
40</file>
41</client>
42
43# Verify data after the test has been "shot"
44<verify>
45<strip>
46^(Content-Type: multipart/form-data;|-------).*
47</strip>
48<protocol>
49POST /we/want/%TESTNUMBER HTTP/1.1
50Host: %HOSTIP:%HTTPPORT
51User-Agent: curl/%VERSION
52Accept: */*
53Content-Length: 1234
54Content-Type: multipart/form-data; boundary=----------------------------24e78000bd32
55
56------------------------------24e78000bd32
57Content-Disposition: form-data; name="name"
58
59daniel
60------------------------------24e78000bd32
61Content-Disposition: form-data; name="tool"
62
63curl
64------------------------------24e78000bd32
65Content-Disposition: form-data; name="str1"
66
67@literal
68------------------------------24e78000bd32
69Content-Disposition: form-data; name="str2"
70
71<verbatim;type=xxx/yyy
72------------------------------24e78000bd32
73Content-Disposition: form-data; name="file"; filename="fakerfile"
74Content-Type: moo/foobar
75
76foo bar
77This is a bar foo
78bar
79foo
80
81------------------------------24e78000bd32
82Content-Disposition: form-data; name="file2"; filename="test%TESTNUMBER.txt"
83Content-Type: text/plain
84
85foo bar
86This is a bar foo
87bar
88foo
89
90------------------------------24e78000bd32
91Content-Disposition: form-data; name="file3"; filename="f\\ak\\er,\an\d;.t%22xt"
92Content-Type: mo/foo
93
94foo bar
95This is a bar foo
96bar
97foo
98
99------------------------------24e78000bd32
100Content-Disposition: form-data; name="file4"; filename="A\AA%22%22\%22ZZZ"
101Content-Type: text/plain
102
103foo bar
104This is a bar foo
105bar
106foo
107
108------------------------------24e78000bd32--
109</protocol>
110</verify>
111</testcase>
112