Update of /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin
In directory usw-pr-cvs1:/tmp/cvs-serv13588/lib/HTTP/WebTest/Plugin
Modified Files:
SetRequest.pm
Log Message:
Added docs on file upload tests
Index: SetRequest.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/lib/HTTP/WebTest/Plugin/SetRequest.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** SetRequest.pm 24 Jul 2002 21:16:33 -0000 1.12
--- SetRequest.pm 24 Jul 2002 22:18:36 -0000 1.13
***************
*** 58,67 ****
A list of name/value pairs to be passed as parameters to the URL.
(This element is used to test pages that process input from forms.)
- Unless the method key is set to C<POST>, these pairs are URI-escaped
- and appended to the requested URL.
! The names and values will be URI-escaped as defined by RFC 2396.
! =head3 Example
url = http://www.hotmail.com/cgi-bin/hmhome
--- 58,66 ----
A list of name/value pairs to be passed as parameters to the URL.
(This element is used to test pages that process input from forms.)
! If the method key is set to C<GET>, these pairs are URI-escaped and
! appended to the requested URL.
! Example (wtscript file):
url = http://www.hotmail.com/cgi-bin/hmhome
***************
*** 71,77 ****
HotMail )
! generates the HTTP request:
http://www.hotmail.com/cgi-bin/hmhome?curmbox=F001%20A005&from=HotMail
=head2 auth
--- 70,120 ----
HotMail )
! generates the HTTP request with URI:
http://www.hotmail.com/cgi-bin/hmhome?curmbox=F001%20A005&from=HotMail
+
+ If the method key is set to C<POST>, as long as all values are scalars
+ they are URI-escaped and put into content of the HTTP request.
+ C<application/x-www-form-urlencoded> content type is set for such HTTP
+ request.
+
+ If the method key is set to C<POST>, some values may be defined as
+ lists. In this case L<HTTP::WebTest|HTTP::WebTest> uses
+ C<multipart/form-data> content type used for C<Form-based File Upload>
+ as specified in RFC 1867. Each parameter with list value is treated
+ as file part specification specification with the following
+ interpretation:
+
+ ( FILE, FILENAME, HEADER => VALUE... )
+
+ where
+
+ =over 4
+
+ =item * FILE
+
+ The name of a file to open. This file will be read and its content
+ placed in the request.
+
+ =item * FILENAME
+
+ The optional filename to be reported in the request. If it is not
+ specified than basename of C<FILE> is used.
+
+ =item * HEADER => VALUE
+
+ Additional optional headers for file part.
+
+ Example (wtscript file):
+
+ url = http://www.server.com/upload.pl
+ method = post
+ params = ( submit => ok
+ file => ( '/home/ilya/file.txt', 'myfile.txt' ) )
+
+ It generates HTTP request with C</home/ilya/file.txt> file included
+ and reported under name C<myfile.txt>.
+
+ =back
=head2 auth
|