xref: /curl/tests/data/test1315 (revision 3fd80c7b)
1<testcase>
2# Based on tests 186 and 1053
3<info>
4<keywords>
5HTTP
6HTTP FORMPOST
7HTTP file upload
8</keywords>
9</info>
10
11# Server-side
12<reply>
13<data>
14HTTP/1.1 200 OK
15Date: Thu, 29 Jul 2008 14:49:00 GMT
16Server: test-server/fake
17Content-Length: 0
18Connection: close
19
20</data>
21</reply>
22
23# Client-side
24<client>
25<features>
26Mime
27</features>
28<server>
29http
30</server>
31<name>
32HTTP RFC1867-type formposting - -F with three files, one with explicit type
33</name>
34<command>
35http://%HOSTIP:%HTTPPORT/we/want/%TESTNUMBER -F name=value -F 'file=@%LOGDIR/test%TESTNUMBER.txt,%LOGDIR/test%TESTNUMBER.txt;type=magic/content,%LOGDIR/test%TESTNUMBER.txt'
36</command>
37# We create this file before the command is invoked!
38<file name="%LOGDIR/test%TESTNUMBER.txt">
39dummy data
40</file>
41</client>
42
43# Verify data after the test has been "shot"
44<verify>
45<strip>
46-----+\w+
47</strip>
48<protocol>
49POST /we/want/%TESTNUMBER HTTP/1.1
50Host: %HOSTIP:%HTTPPORT
51User-Agent: curl/%VERSION
52Accept: */*
53Content-Length: 845
54Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763
55
56------------------------------9ef8d6205763
57Content-Disposition: form-data; name="name"
58
59value
60------------------------------9ef8d6205763
61Content-Disposition: form-data; name="file"
62Content-Type: multipart/mixed; boundary=----------------------------aaaaaaaaaaaa
63
64Content-Disposition: attachment; filename="test%TESTNUMBER.txt"
65Content-Type: text/plain
66
67dummy data
68
69------------------------------9ef8d6205763
70Content-Disposition: attachment; filename="test%TESTNUMBER.txt"
71Content-Type: magic/content
72
73dummy data
74
75------------------------------9ef8d6205763
76Content-Disposition: attachment; filename="test%TESTNUMBER.txt"
77Content-Type: text/plain
78
79dummy data
80
81------------------------------aaaaaaaaaaaa--
82
83------------------------------9ef8d6205763--
84</protocol>
85</verify>
86</testcase>
87