OK, I'm a programmer, not a writer. Be gentle.
Nothing major, just the a mention of cookie_jar and additional headers via the second param in GET (and probably others?).


While I was at it, I made sure all of the need* examples were all the same; which meant removing \& and &. The bare versions seemed to be the most prevelant.

-=Chris
Index: Test.pm
===================================================================
--- Test.pm     (revision 109410)
+++ Test.pm     (working copy)
@@ -604,7 +604,7 @@
 the tests will be skipped if the function returns a false value. For
 example:
 
-    plan tests => 5, \&need_lwp;
+    plan tests => 5, need_lwp;
 
 the test will be skipped if LWP is not available
 
@@ -654,13 +654,13 @@
 
 =item need_http11
 
-  plan tests => 5, &need_http11;
+  plan tests => 5, need_http11;
 
 Require HTTP/1.1 support.
 
 =item need_ssl
 
-  plan tests => 5, &need_ssl;
+  plan tests => 5, need_ssl;
 
 Require SSL support.
 
@@ -668,13 +668,13 @@
 
 =item need_lwp
 
-  plan tests => 5, &need_lwp;
+  plan tests => 5, need_lwp;
 
 Require LWP support.
 
 =item need_cgi
 
-  plan tests => 5, &need_cgi;
+  plan tests => 5, need_cgi;
 
 Requires mod_cgi or mod_cgid to be installed.
 
Index: TestRequest.pm
===================================================================
--- TestRequest.pm      (revision 109410)
+++ TestRequest.pm      (working copy)
@@ -780,6 +780,19 @@
 installed. It's best, therefore, to check C<have_lwp> before running
 tests that rely on a redirection from C<POST>.
 
+Sometimes it is desireable to have C<Apache::TestRequest> remember
+cookies sent by the pages you are testing and send them back to the
+server on subsequent requests. This is especially necessary when
+testing pages whose functionality relies on sessions or the presence
+of preferences stored in cookies.
+
+By default, C<LWP::UserAgent> does B<not> remember cookies between
+requests. You can tell it to remember cookies by adding the following
+to C<user_agent()>:
+
+  Apache::TestRequest::user_agent(reset =>,
+                                  cookie_jar => {});
+
 =head1 FUNCTIONS
 
 C<Apache::TestRequest> exports a number of functions that will likely
@@ -837,6 +850,11 @@
 Sends a simple GET request to the Apache test server. Returns an
 C<HTTP::Response> object.
 
+You can also supply additional headers to be sent with the request
+by adding their name/value pairs after the C<url> parameter:
+
+  my $res = GET $url, 'Accept-Language' => 'de,en-us,en;q=0.5';
+
 =head3 GET_STR
 
 A shortcut function for C<GET($uri)-E<gt>as_string>.

Reply via email to