• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<testcase>
2# Based on test 9
3<info>
4<keywords>
5HTTP
6HTTP FORMPOST
7HTTP file upload
8followlocation
9</keywords>
10</info>
11
12# Server-side
13<reply>
14<data>
15HTTP/1.1 307 Redirect swsclose
16Date: Thu, 29 Jul 2008 14:49:00 GMT
17Server: test-server/fake
18Location: data/10530002.txt?coolsite=yes
19Content-Length: 0
20Connection: close
21
22</data>
23<data2>
24HTTP/1.1 200 OK swsclose
25Date: Thu, 09 Nov 2010 14:49:00 GMT
26Server: test-server/fake
27Content-Length: 11
28Connection: close
29
30blablabla
31
32</data2>
33<datacheck>
34HTTP/1.1 307 Redirect swsclose
35Date: Thu, 29 Jul 2008 14:49:00 GMT
36Server: test-server/fake
37Location: data/10530002.txt?coolsite=yes
38Content-Length: 0
39Connection: close
40
41HTTP/1.1 200 OK swsclose
42Date: Thu, 09 Nov 2010 14:49:00 GMT
43Server: test-server/fake
44Content-Length: 11
45Connection: close
46
47blablabla
48
49</datacheck>
50</reply>
51
52# Client-side
53<client>
54<server>
55http
56</server>
57 <name>
58HTTP RFC1867-type formposting from file with Location: following
59 </name>
60 <command>
61http://%HOSTIP:%HTTPPORT/we/want/1053 -L -F name=daniel -F tool=curl -F file=@log/test1053.txt
62</command>
63# We create this file before the command is invoked!
64<file name="log/test1053.txt">
65foo-
66This is a moo-
67bar
68</file>
69</client>
70
71# Verify data after the test has been "shot"
72<verify>
73<strip>
74^(User-Agent:|Content-Type: multipart/form-data;|------------).*
75</strip>
76<protocol>
77POST /we/want/1053 HTTP/1.1
78User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4
79Host: %HOSTIP:%HTTPPORT
80Accept: */*
81Content-Length: 410
82Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763
83
84------------------------------9ef8d6205763
85Content-Disposition: form-data; name="name"
86
87daniel
88------------------------------9ef8d6205763
89Content-Disposition: form-data; name="tool"
90
91curl
92------------------------------9ef8d6205763
93Content-Disposition: form-data; name="file"; filename="test1053.txt"
94Content-Type: text/plain
95
96foo-
97This is a moo-
98bar
99
100------------------------------9ef8d6205763--
101POST /we/want/data/10530002.txt?coolsite=yes HTTP/1.1
102User-Agent: curl/7.18.2 (i686-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.7a ipv6 zlib/1.1.4
103Host: %HOSTIP:%HTTPPORT
104Accept: */*
105Content-Length: 410
106Content-Type: multipart/form-data; boundary=----------------------------9ef8d6205763
107
108------------------------------9ef8d6205763
109Content-Disposition: form-data; name="name"
110
111daniel
112------------------------------9ef8d6205763
113Content-Disposition: form-data; name="tool"
114
115curl
116------------------------------9ef8d6205763
117Content-Disposition: form-data; name="file"; filename="test1053.txt"
118Content-Type: text/plain
119
120foo-
121This is a moo-
122bar
123
124------------------------------9ef8d6205763--
125</protocol>
126</verify>
127</testcase>
128