Imported Upstream version 6.22 upstream/6.22
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 21 Jul 2022 02:28:22 +0000 (11:28 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 21 Jul 2022 02:28:22 +0000 (11:28 +0900)
32 files changed:
Changes
META.json
META.yml
Makefile.PL
bin/lwp-request
dist.ini
lib/LWP.pm
lib/LWP/Authen/Basic.pm
lib/LWP/Authen/Digest.pm
lib/LWP/Authen/Ntlm.pm
lib/LWP/ConnCache.pm
lib/LWP/Debug.pm
lib/LWP/Debug/TraceHTTP.pm
lib/LWP/DebugFile.pm
lib/LWP/MemberMixin.pm
lib/LWP/Protocol.pm
lib/LWP/Protocol/cpan.pm
lib/LWP/Protocol/data.pm
lib/LWP/Protocol/file.pm
lib/LWP/Protocol/ftp.pm
lib/LWP/Protocol/gopher.pm
lib/LWP/Protocol/http.pm
lib/LWP/Protocol/loopback.pm
lib/LWP/Protocol/mailto.pm
lib/LWP/Protocol/nntp.pm
lib/LWP/Protocol/nogo.pm
lib/LWP/RobotUA.pm
lib/LWP/Simple.pm
lib/LWP/UserAgent.pm
t/base/default_content_type.t
xt/author/pod-coverage.t
xt/release/changes_has_content.t

diff --git a/Changes b/Changes
index 353f3ad62aeef58ab7dfe579b3405bde56b0b69e..70c35f756bad76dba44b5c6361d800c750f1481a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,11 @@
 Change history for libwww-perl
 
+6.22      2017-03-01
+    - Update Travis-CI to test on minimum versions of prereqs. (GH PR #109)
+    - Fix tests that depended on a newer version of HTTP::Message (GH PR #119)
+    - Update documentation to reflect behavior difference in ->put() depending
+      on the version of HTTP::Message installed. (GH PR #120)
+
 6.21      2017-02-21
     - Ensure that LWP::Simple re-exports some HTTP::Status functions
 
index 24d5cce3c5becb734546f263709d9df241d1fe0c..40d3f1199a0df0465c79d5728672e4b1afa283aa 100644 (file)
--- a/META.json
+++ b/META.json
    "provides" : {
       "LWP" : {
          "file" : "lib/LWP.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Authen::Basic" : {
          "file" : "lib/LWP/Authen/Basic.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Authen::Digest" : {
          "file" : "lib/LWP/Authen/Digest.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Authen::Ntlm" : {
          "file" : "lib/LWP/Authen/Ntlm.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::ConnCache" : {
          "file" : "lib/LWP/ConnCache.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Debug" : {
          "file" : "lib/LWP/Debug.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Debug::TraceHTTP" : {
          "file" : "lib/LWP/Debug/TraceHTTP.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Debug::TraceHTTP::Socket" : {
          "file" : "lib/LWP/Debug/TraceHTTP.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::DebugFile" : {
          "file" : "lib/LWP/DebugFile.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::MemberMixin" : {
          "file" : "lib/LWP/MemberMixin.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol" : {
          "file" : "lib/LWP/Protocol.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol::MyFTP" : {
          "file" : "lib/LWP/Protocol/ftp.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol::cpan" : {
          "file" : "lib/LWP/Protocol/cpan.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol::data" : {
          "file" : "lib/LWP/Protocol/data.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol::file" : {
          "file" : "lib/LWP/Protocol/file.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol::ftp" : {
          "file" : "lib/LWP/Protocol/ftp.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol::gopher" : {
          "file" : "lib/LWP/Protocol/gopher.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol::http" : {
          "file" : "lib/LWP/Protocol/http.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol::http::Socket" : {
          "file" : "lib/LWP/Protocol/http.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol::http::SocketMethods" : {
          "file" : "lib/LWP/Protocol/http.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol::loopback" : {
          "file" : "lib/LWP/Protocol/loopback.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol::mailto" : {
          "file" : "lib/LWP/Protocol/mailto.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol::nntp" : {
          "file" : "lib/LWP/Protocol/nntp.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Protocol::nogo" : {
          "file" : "lib/LWP/Protocol/nogo.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::RobotUA" : {
          "file" : "lib/LWP/RobotUA.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::Simple" : {
          "file" : "lib/LWP/Simple.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       },
       "LWP::UserAgent" : {
          "file" : "lib/LWP/UserAgent.pm",
-         "version" : "6.21"
+         "version" : "6.22"
       }
    },
    "release_status" : "stable",
       "x_IRC" : "irc://irc.perl.org/#lwp",
       "x_MailingList" : "mailto:libwww@perl.org"
    },
-   "version" : "6.21",
+   "version" : "6.22",
    "x_Dist_Zilla" : {
       "perl" : {
          "version" : "5.024000"
                   "branch" : null,
                   "changelog" : "Changes",
                   "signed" : 0,
-                  "tag" : "v6.21",
+                  "tag" : "v6.22",
                   "tag_format" : "v%v",
                   "tag_message" : "v%v"
                },
index 1126363660b6e7dd0cf99c06d787b3d32b0d5be5..0de29551d5a600d0bd9febb86cc6b21498d83df8 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -27,85 +27,85 @@ no_index:
 provides:
   LWP:
     file: lib/LWP.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Authen::Basic:
     file: lib/LWP/Authen/Basic.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Authen::Digest:
     file: lib/LWP/Authen/Digest.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Authen::Ntlm:
     file: lib/LWP/Authen/Ntlm.pm
-    version: '6.21'
+    version: '6.22'
   LWP::ConnCache:
     file: lib/LWP/ConnCache.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Debug:
     file: lib/LWP/Debug.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Debug::TraceHTTP:
     file: lib/LWP/Debug/TraceHTTP.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Debug::TraceHTTP::Socket:
     file: lib/LWP/Debug/TraceHTTP.pm
-    version: '6.21'
+    version: '6.22'
   LWP::DebugFile:
     file: lib/LWP/DebugFile.pm
-    version: '6.21'
+    version: '6.22'
   LWP::MemberMixin:
     file: lib/LWP/MemberMixin.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol:
     file: lib/LWP/Protocol.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol::MyFTP:
     file: lib/LWP/Protocol/ftp.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol::cpan:
     file: lib/LWP/Protocol/cpan.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol::data:
     file: lib/LWP/Protocol/data.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol::file:
     file: lib/LWP/Protocol/file.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol::ftp:
     file: lib/LWP/Protocol/ftp.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol::gopher:
     file: lib/LWP/Protocol/gopher.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol::http:
     file: lib/LWP/Protocol/http.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol::http::Socket:
     file: lib/LWP/Protocol/http.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol::http::SocketMethods:
     file: lib/LWP/Protocol/http.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol::loopback:
     file: lib/LWP/Protocol/loopback.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol::mailto:
     file: lib/LWP/Protocol/mailto.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol::nntp:
     file: lib/LWP/Protocol/nntp.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Protocol::nogo:
     file: lib/LWP/Protocol/nogo.pm
-    version: '6.21'
+    version: '6.22'
   LWP::RobotUA:
     file: lib/LWP/RobotUA.pm
-    version: '6.21'
+    version: '6.22'
   LWP::Simple:
     file: lib/LWP/Simple.pm
-    version: '6.21'
+    version: '6.22'
   LWP::UserAgent:
     file: lib/LWP/UserAgent.pm
-    version: '6.21'
+    version: '6.22'
 requires:
   Digest::MD5: '0'
   Encode: '2.12'
@@ -142,7 +142,7 @@ resources:
   bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=libwww-perl
   homepage: https://github.com/libwww-perl/libwww-perl
   repository: https://github.com/libwww-perl/libwww-perl.git
-version: '6.21'
+version: '6.22'
 x_Dist_Zilla:
   perl:
     version: '5.024000'
@@ -252,7 +252,7 @@ x_Dist_Zilla:
           branch: ~
           changelog: Changes
           signed: 0
-          tag: v6.21
+          tag: v6.22
           tag_format: v%v
           tag_message: v%v
         Dist::Zilla::Role::Git::Repo:
index cfef3521e041582723712b4b410d65429d8e9cc7..1e21c2145c16007bb019c7c804e49f7c7de1bebb 100644 (file)
@@ -83,7 +83,7 @@ my %WriteMakefileArgs = (
     "Test::More" => 0,
     "Test::RequiresInternet" => 0
   },
-  "VERSION" => "6.21",
+  "VERSION" => "6.22",
   "test" => {
     "TESTS" => "t/*.t t/base/*.t t/local/*.t t/robot/*.t"
   }
index 4c2125a94fe9ed520af7487303d04be98e2fc103..cde097273870c62620754ab65d4754cfaaeabc8d 100755 (executable)
@@ -217,7 +217,7 @@ use HTTP::Date qw(time2str str2time);
 # user/password if document is protected.
 {
     package RequestAgent;
-$RequestAgent::VERSION = '6.21';
+$RequestAgent::VERSION = '6.22';
 use base qw(LWP::UserAgent);
 
     sub new
index d8f7d80350c7b3c76fced7411a7906df4ec7f493..920bdb658a3169c3847febd8328367e45ac52dcb 100644 (file)
--- a/dist.ini
+++ b/dist.ini
@@ -4,7 +4,7 @@ license             = Perl_5
 copyright_holder    = Gisle Aas
 copyright_year      = 1995
 
-version = 6.21
+version = 6.22
 
 ; Gather stuff in
 [Git::GatherDir]
index 841c7cf7f0964490167aebba5546c1b40a12fd4f..52b38440f88795d58885cbedc93020f20d50d64c 100644 (file)
@@ -1,6 +1,6 @@
 package LWP;
 
-our $VERSION = '6.21';
+our $VERSION = '6.22';
 
 require 5.008;
 require LWP::UserAgent;  # this should load everything you need
index 6685c745b04a31402ef43656c060f5bcb0657cc5..b266563a0b4949bfa229b39743fc33b9ed0d84e2 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::Authen::Basic;
-$LWP::Authen::Basic::VERSION = '6.21';
+$LWP::Authen::Basic::VERSION = '6.22';
 use strict;
 
 require MIME::Base64;
index 57501d6dab371205c2402e808be14d5869de4bf3..5d9f1231364cdcf32537d036d2efb10e1d677553 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::Authen::Digest;
-$LWP::Authen::Digest::VERSION = '6.21';
+$LWP::Authen::Digest::VERSION = '6.22';
 use strict;
 use base 'LWP::Authen::Basic';
 
index b151f57ec8bf07e97c324a9e3f77fa1db71f7e8b..28a2f4d4bd2caab99b3021aa344d5b731144847c 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Authen::Ntlm;
 
 use strict;
 
-our $VERSION = '6.21';
+our $VERSION = '6.22';
 
 use Authen::NTLM "1.02";
 use MIME::Base64 "2.12";
index c0574681ac64cf3f84357e57e4e1d04061b38b30..f9be7b177630bce61caa400bb696304439514769 100644 (file)
@@ -2,7 +2,7 @@ package LWP::ConnCache;
 
 use strict;
 
-our $VERSION = '6.21';
+our $VERSION = '6.22';
 our $DEBUG;
 
 sub new {
index 8049188f20a7ff7cc4fa5b3a904de9001345bd47..d059b2b30756ddcb663fe48ea18f32edacb12a32 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::Debug;    # legacy
-$LWP::Debug::VERSION = '6.21';
+$LWP::Debug::VERSION = '6.22';
 require Exporter;
 our @ISA       = qw(Exporter);
 our @EXPORT_OK = qw(level trace debug conns);
index 3fd6cad7396647d40a814dc621b8d653d84ea17c..57ef84abd706fc6c7c4515a460431839f865f3a1 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::Debug::TraceHTTP;
-$LWP::Debug::TraceHTTP::VERSION = '6.21';
+$LWP::Debug::TraceHTTP::VERSION = '6.22';
 # Just call:
 #
 #   require LWP::Debug::TraceHTTP;
@@ -12,7 +12,7 @@ use strict;
 use base 'LWP::Protocol::http';
 
 package LWP::Debug::TraceHTTP::Socket;
-$LWP::Debug::TraceHTTP::Socket::VERSION = '6.21';
+$LWP::Debug::TraceHTTP::Socket::VERSION = '6.22';
 use Data::Dump 1.13;
 use Data::Dump::Trace qw(autowrap mcall);
 
index 7ca5fb312f0ee92337c42bda23877ba1c59202a6..66c8a7ac326e0a1b0baa272c53445dfd363776e6 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::DebugFile;
-$LWP::DebugFile::VERSION = '6.21';
+$LWP::DebugFile::VERSION = '6.22';
 # legacy stub
 
 1;
index a35bedc93d4d3362f0b904adb422f2d6accdb5c8..32e679573f5c107e0b68da81b43fd79c7386430b 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::MemberMixin;
-$LWP::MemberMixin::VERSION = '6.21';
+$LWP::MemberMixin::VERSION = '6.22';
 sub _elem {
     my $self = shift;
     my $elem = shift;
index 846ec6a343b063e87ee62f1902d2ab76dd2ee937..076855edcce01d2da6b0e6598178c264cc54af9b 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Protocol;
 
 use base 'LWP::MemberMixin';
 
-our $VERSION = '6.21';
+our $VERSION = '6.22';
 
 use strict;
 use Carp ();
index 83831707249af4833cdbc42c836b53c54f2901a0..c39dc4fd4ebe1793b733661db048628a2207e0e5 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::Protocol::cpan;
-$LWP::Protocol::cpan::VERSION = '6.21';
+$LWP::Protocol::cpan::VERSION = '6.22';
 use strict;
 
 use base qw(LWP::Protocol);
index 21a59b2916567715c5433c18d09ab049e6b8dac3..bd555115be59f7a2a807f703ddb46255ad470537 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::Protocol::data;
-$LWP::Protocol::data::VERSION = '6.21';
+$LWP::Protocol::data::VERSION = '6.22';
 # Implements access to data:-URLs as specified in RFC 2397
 
 use strict;
index 9d7b90db888308b8f544b2dc3c198974e6f6d08d..b6740769f526865c1768560227afe8f210b74e42 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::Protocol::file;
-$LWP::Protocol::file::VERSION = '6.21';
+$LWP::Protocol::file::VERSION = '6.22';
 use base qw(LWP::Protocol);
 
 use strict;
index cb4c4e031682cfce55ffa6af42f9c9c5b338aa21..c4d4af196b76708cd489fd9646e1dcd45219c482 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::Protocol::ftp;
-$LWP::Protocol::ftp::VERSION = '6.21';
+$LWP::Protocol::ftp::VERSION = '6.22';
 # Implementation of the ftp protocol (RFC 959). We let the Net::FTP
 # package do all the dirty work.
 
@@ -16,7 +16,7 @@ use base qw(LWP::Protocol);
 use strict;
 eval {
     package LWP::Protocol::MyFTP;
-$LWP::Protocol::MyFTP::VERSION = '6.21';
+$LWP::Protocol::MyFTP::VERSION = '6.22';
 require Net::FTP;
     Net::FTP->require_version(2.00);
 
index 939381fbf6c0e03a95e3d5591fd825ec70b00d62..18a4433bf1fe52640b7b910ef49705cdc280e24d 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::Protocol::gopher;
-$LWP::Protocol::gopher::VERSION = '6.21';
+$LWP::Protocol::gopher::VERSION = '6.22';
 # Implementation of the gopher protocol (RFC 1436)
 #
 # This code is based on 'wwwgopher.pl,v 0.10 1994/10/17 18:12:34 shelden'
index 457d239bcafc216cf55d1dc1ff99ea11a5e66959..4c45279a6538d2648f12f53fb57a48e6d77aabdf 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::Protocol::http;
-$LWP::Protocol::http::VERSION = '6.21';
+$LWP::Protocol::http::VERSION = '6.22';
 use strict;
 
 require HTTP::Response;
@@ -498,7 +498,7 @@ sub request
 
 #-----------------------------------------------------------
 package LWP::Protocol::http::SocketMethods;
-$LWP::Protocol::http::SocketMethods::VERSION = '6.21';
+$LWP::Protocol::http::SocketMethods::VERSION = '6.22';
 sub ping {
     my $self = shift;
     !$self->can_read(0);
@@ -511,7 +511,7 @@ sub increment_response_count {
 
 #-----------------------------------------------------------
 package LWP::Protocol::http::Socket;
-$LWP::Protocol::http::Socket::VERSION = '6.21';
+$LWP::Protocol::http::Socket::VERSION = '6.22';
 use base qw(LWP::Protocol::http::SocketMethods Net::HTTP);
 
 1;
index 61489dcff24ff7220a9b2e66447ba5db732218d0..a0e424211118590ca9e85cb62f108bceb6092dc0 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::Protocol::loopback;
-$LWP::Protocol::loopback::VERSION = '6.21';
+$LWP::Protocol::loopback::VERSION = '6.22';
 use strict;
 require HTTP::Response;
 
index c47ef21090d249fba2125b5344e9a7ea167bf5a8..99aa455e6653b62ec493e9bb181aad208f3e1488 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::Protocol::mailto;
-$LWP::Protocol::mailto::VERSION = '6.21';
+$LWP::Protocol::mailto::VERSION = '6.22';
 # This module implements the mailto protocol.  It is just a simple
 # frontend to the Unix sendmail program except on MacOS, where it uses
 # Mail::Internet.
index 186ccbc0468712acb3486933e7f11f54f2fa7efd..5a81d4d4955ae165b231b3cba200a06c59387296 100644 (file)
@@ -1,5 +1,5 @@
 package LWP::Protocol::nntp;
-$LWP::Protocol::nntp::VERSION = '6.21';
+$LWP::Protocol::nntp::VERSION = '6.22';
 # Implementation of the Network News Transfer Protocol (RFC 977)
 
 use base qw(LWP::Protocol);
index 8d6a05193be670cece724fcb867047681ae20d11..0590e9ca8e539340eb782a0c9a5bc8ac3e0b326b 100644 (file)
@@ -4,7 +4,7 @@ package LWP::Protocol::nogo;
 #   LWP::Protocol::implementor(that_scheme, 'LWP::Protocol::nogo');
 # For then on, attempts to access URLs with that scheme will generate
 # a 500 error.
-$LWP::Protocol::nogo::VERSION = '6.21';
+$LWP::Protocol::nogo::VERSION = '6.22';
 use strict;
 
 require HTTP::Response;
index d3700ccc31945225c6678d992f62d8c2291bfe78..5deb6b2226a494bf57ea92d01604da43c8df2a1e 100644 (file)
@@ -2,7 +2,7 @@ package LWP::RobotUA;
 
 use base qw(LWP::UserAgent);
 
-our $VERSION = '6.21';
+our $VERSION = '6.22';
 
 require WWW::RobotRules;
 require HTTP::Request;
index 7221fc924cf3bf8857503bb6cdf01de9f87c3710..8176dbb0f0b380523fe6a51e6a28c162ce0c9d91 100644 (file)
@@ -2,7 +2,7 @@ package LWP::Simple;
 
 use strict;
 
-our $VERSION = '6.21';
+our $VERSION = '6.22';
 
 require Exporter;
 
index 46bc57c14c2200d2759d070eb8658db86c421945..f15b855194328e29b1d4ebe5984b8eaddd2eec95 100644 (file)
@@ -15,7 +15,7 @@ use LWP::Protocol ();
 use Scalar::Util qw(blessed);
 use Try::Tiny qw(try catch);
 
-our $VERSION = '6.21';
+our $VERSION = '6.22';
 
 sub new
 {
@@ -1643,13 +1643,12 @@ the given processing phase.
 The methods described in this section are used to dispatch requests
 via the user agent.  The following request methods are provided:
 
-=over
-
-=item $ua->get( $url )
+=head2 get
 
-=item $ua->get( $url , $field_name => $value, ... )
+    my $res = $ua->get( $url );
+    my $res = $ua->get( $url , $field_name => $value, ... );
 
-This method will dispatch a C<GET> request on the given $url.  Further
+This method will dispatch a C<GET> request on the given URL.  Further
 arguments can be given to initialize the headers of the request. These
 are given as separate name/value pairs.  The return value is a
 response object.  See L<HTTP::Response> for a description of the
@@ -1698,103 +1697,112 @@ object.  The callback can abort the request by invoking die().  The
 exception message will show up as the "X-Died" header field in the
 response returned by the get() function.
 
-=item $ua->head( $url )
-
-=item $ua->head( $url , $field_name => $value, ... )
-
-This method will dispatch a C<HEAD> request on the given $url.
-Otherwise it works like the get() method described above.
-
-=item $ua->post( $url, \%form )
-
-=item $ua->post( $url, \@form )
+=head2 head
 
-=item $ua->post( $url, \%form, $field_name => $value, ... )
+    my $res = $ua->head( $url );
+    my $res = $ua->head( $url , $field_name => $value, ... );
 
-=item $ua->post( $url, $field_name => $value,... Content => \%form )
+This method will dispatch a C<HEAD> request on the given URL.
+Otherwise it works like the L<LWP::UserAgent/get> method described above.
 
-=item $ua->post( $url, $field_name => $value,... Content => \@form )
+=head2 post
 
-=item $ua->post( $url, $field_name => $value,... Content => $content )
+    my $res = $ua->post( $url, \%form );
+    my $res = $ua->post( $url, \@form );
+    my $res = $ua->post( $url, \%form, $field_name => $value, ... );
+    my $res = $ua->post( $url, $field_name => $value, Content => \%form );
+    my $res = $ua->post( $url, $field_name => $value, Content => \@form );
+    my $res = $ua->post( $url, $field_name => $value, Content => $content );
 
-This method will dispatch a C<POST> request on the given $url, with
-%form or @form providing the key/value pairs for the fill-in form
+This method will dispatch a C<POST> request on the given URL, with
+C<%form> or C<@form> providing the key/value pairs for the fill-in form
 content. Additional headers and content options are the same as for
-the get() method.
+the L<LWP::UserAgent/get> method.
 
-This method will use the POST() function from L<HTTP::Request::Common>
+This method will use the C<POST> function from L<HTTP::Request::Common>
 to build the request.  See L<HTTP::Request::Common> for a details on
 how to pass form content and other advanced features.
 
-=item $ua->put( $url, \%form )
+=head2 put
 
-=item $ua->put( $url, \@form )
+    # Any version of HTTP::Message works with this form:
+    my $res = $ua->put( $url, $field_name => $value, Content => $content );
 
-=item $ua->put( $url, \%form, $field_name => $value, ... )
+    # Using hash or array references requires HTTP::Message >= 6.07
+    use HTTP::Request 6.07;
+    my $res = $ua->put( $url, \%form );
+    my $res = $ua->put( $url, \@form );
+    my $res = $ua->put( $url, \%form, $field_name => $value, ... );
+    my $res = $ua->put( $url, $field_name => $value, Content => \%form );
+    my $res = $ua->put( $url, $field_name => $value, Content => \@form );
 
-=item $ua->put( $url, $field_name => $value,... Content => \%form )
-
-=item $ua->put( $url, $field_name => $value,... Content => \@form )
+This method will dispatch a C<PUT> request on the given URL, with
+C<%form> or C<@form> providing the key/value pairs for the fill-in form
+content. Additional headers and content options are the same as for
+the L<LWP::UserAgent/get> method.
 
-=item $ua->put( $url, $field_name => $value,... Content => $content )
+CAVEAT:
 
-This method will dispatch a C<PUT> request on the given $url, with
-%form or @form providing the key/value pairs for the fill-in form
-content. Additional headers and content options are the same as for
-the get() method.
+This method can only accept content that is in key-value pairs when using
+L<HTTP::Request::Common> prior to version C<6.07>. Any use of hash or array
+references will result in an error prior to version C<6.07>.
 
-This method will use the PUT() function from L<HTTP::Request::Common>
+This method will use the C<PUT> function from L<HTTP::Request::Common>
 to build the request.  See L<HTTP::Request::Common> for a details on
 how to pass form content and other advanced features.
 
-=item $ua->delete( $url )
+=head2 delete
 
-=item $ua->delete( $url, $field_name => $value, ... )
+    my $res = $ua->delete( $url );
+    my $res = $ua->delete( $url, $field_name => $value, ... );
 
-This method will dispatch a C<DELETE> request on the given $url.  Additional
-headers and content options are the same as for the get() method.
+This method will dispatch a C<DELETE> request on the given URL.  Additional
+headers and content options are the same as for the L<LWP::UserAgent/get>
+method.
 
 This method will use the DELETE() function from L<HTTP::Request::Common>
 to build the request.  See L<HTTP::Request::Common> for a details on
 how to pass form content and other advanced features.
 
-=item $ua->mirror( $url, $filename )
+=head2 mirror
 
-This method will get the document identified by $url and store it in
-file called $filename.  If the file already exists, then the request
-will contain an "If-Modified-Since" header matching the modification
+    my $res = $ua->mirror( $url, $filename );
+
+This method will get the document identified by URL and store it in
+file called C<$filename>.  If the file already exists, then the request
+will contain an C<If-Modified-Since> header matching the modification
 time of the file.  If the document on the server has not changed since
 this time, then nothing happens.  If the document has been updated, it
 will be downloaded again.  The modification time of the file will be
 forced to match that of the server.
 
-The return value is the response object.
-
-=item $ua->request( $request )
-
-=item $ua->request( $request, $content_file )
+The return value is an L<HTTP::Response> object.
 
-=item $ua->request( $request, $content_cb )
+=head2 request
 
-=item $ua->request( $request, $content_cb, $read_size_hint )
+    my $res = $ua->request( $request );
+    my $res = $ua->request( $request, $content_file );
+    my $res = $ua->request( $request, $content_cb );
+    my $res = $ua->request( $request, $content_cb, $read_size_hint );
 
-This method will dispatch the given $request object.  Normally this
+This method will dispatch the given C<$request> object.  Normally this
 will be an instance of the L<HTTP::Request> class, but any object with
-a similar interface will do.  The return value is a response object.
+a similar interface will do.  The return value is an L<HTTP::Response> object.
 See L<HTTP::Request> and L<HTTP::Response> for a description of the
 interface provided by these classes.
 
-The request() method will process redirects and authentication
+The C<request> method will process redirects and authentication
 responses transparently.  This means that it may actually send several
-simple requests via the simple_request() method described below.
+simple requests via the L<LWP::Simple/simple_request> method described below.
 
-The request methods described above; get(), head(), post() and
-mirror(), will all dispatch the request they build via this method.
-They are convenience methods that simply hides the creation of the
+The request methods described above; L<LWP::Simple/get>, L<LWP::Simple/head>,
+L<LWP::Simple/post> and L<LWP::Simple/mirror> will all dispatch the request
+they build via this method.
+They are convenience methods that simply hide the creation of the
 request object for you.
 
-The $content_file, $content_cb and $read_size_hint all correspond to
-options described with the get() method above.  Note that errors
+The C<$content_file>, C<$content_cb> and C<$read_size_hint> all correspond to
+options described with the L<LWP::Simple/get> method above.  Note that errors
 writing to the content file (for example due to permission denied
 or the filesystem being full) will be reported via the C<Client-Aborted>
 or C<X-Died> response headers, and not the C<is_success> method.
@@ -1805,78 +1813,89 @@ when called.  The content can be returned in chunks.  The content
 function will be invoked repeatedly until it return an empty string to
 signal that there is no more content.
 
-=item $ua->simple_request( $request )
+=head2 simple_request
 
-=item $ua->simple_request( $request, $content_file )
+    my $request = HTTP::Request->new( ... );
+    my $res = $ua->simple_request( $request );
+    my $res = $ua->simple_request( $request, $content_file );
+    my $res = $ua->simple_request( $request, $content_cb );
+    my $res = $ua->simple_request( $request, $content_cb, $read_size_hint );
 
-=item $ua->simple_request( $request, $content_cb )
+This method dispatches a single request and returns the response
+received.  Arguments are the same as for the L<LWP::Simple/request> described above.
 
-=item $ua->simple_request( $request, $content_cb, $read_size_hint )
+The difference from L<LWP::Simple/request> is that C<simple_request> will not try to
+handle redirects or authentication responses.  The L<LWP::Simple/request> method
+will, in fact, invoke this method for each simple request it sends.
 
-This method dispatches a single request and returns the response
-received.  Arguments are the same as for request() described above.
+=head2 is_online
+
+    my $bool = $ua->is_online;
 
-The difference from request() is that simple_request() will not try to
-handle redirects or authentication responses.  The request() method
-will in fact invoke this method for each simple request it sends.
+Tries to determine if you have access to the Internet. Returns C<1> (true)
+if the built-in heuristics determine that the user agent is
+able to access the Internet (over HTTP) or C<0> (false).
 
-=item $ua->is_online
+See also L<LWP::Online>.
 
-Tries to determine if you have access to the Internet.  Returns
-TRUE if the built-in heuristics determine that the user agent is
-able to access the Internet (over HTTP).  See also L<LWP::Online>.
+=head2 is_protocol_supported
 
-=item $ua->is_protocol_supported( $scheme )
+    my $bool = $ua->is_protocol_supported( $scheme );
 
 You can use this method to test whether this user agent object supports the
-specified C<scheme>.  (The C<scheme> might be a string (like 'http' or
-'ftp') or it might be an URI object reference.)
+specified C<scheme>.  (The C<scheme> might be a string (like C<http> or
+C<ftp>) or it might be an L<URI> object reference.)
 
-Whether a scheme is supported, is determined by the user agent's
+Whether a scheme is supported is determined by the user agent's
 C<protocols_allowed> or C<protocols_forbidden> lists (if any), and by
-the capabilities of LWP.  I.e., this will return TRUE only if LWP
+the capabilities of LWP.  I.e., this will return true only if LWP
 supports this protocol I<and> it's permitted for this particular
 object.
 
-=back
-
-=head2 Callback methods
+=head1 Callback methods
 
 The following methods will be invoked as requests are processed. These
 methods are documented here because subclasses of L<LWP::UserAgent>
 might want to override their behaviour.
 
-=over
+=head2 prepare_request
 
-=item $ua->prepare_request( $request )
+    $request = $ua->prepare_request( $request );
 
-This method is invoked by simple_request().  Its task is to modify the
-given $request object by setting up various headers based on the
-attributes of the user agent. The return value should normally be the
-$request object passed in.  If a different request object is returned
+This method is invoked by L<LWP::UserAgent/simple_request>. Its task is
+to modify the given C<$request> object by setting up various headers based
+on the attributes of the user agent. The return value should normally be the
+C<$request> object passed in.  If a different request object is returned
 it will be the one actually processed.
 
-The headers affected by the base implementation are; "User-Agent",
-"From", "Range" and "Cookie".
+The headers affected by the base implementation are; C<User-Agent>,
+C<From>, C<Range> and C<Cookie>.
 
-=item $ua->redirect_ok( $prospective_request, $response )
+=head2 redirect_ok
 
-This method is called by request() before it tries to follow a
-redirection to the request in $response.  This should return a TRUE
-value if this redirection is permissible.  The $prospective_request
-will be the request to be sent if this method returns TRUE.
+    my $bool = $ua->redirect_ok( $prospective_request, $response );
 
-The base implementation will return FALSE unless the method
+This method is called by L<LWP::UserAgent/request> before it tries to follow a
+redirection to the request in C<$response>.  This should return a true
+value if this redirection is permissible.  The C<$prospective_request>
+will be the request to be sent if this method returns true.
+
+The base implementation will return false unless the method
 is in the object's C<requests_redirectable> list,
-FALSE if the proposed redirection is to a "file://..."
-URL, and TRUE otherwise.
+false if the proposed redirection is to a C<file://...>
+URL, and true otherwise.
+
+=head2 get_basic_credentials
 
-=item $ua->get_basic_credentials( $realm, $uri, $isproxy )
+    # This checks wantarray and can either return an array:
+    my ($user, $pass) = $ua->get_basic_credentials( $realm, $uri, $isproxy );
+    # or a string that looks like "user:pass"
+    my $creds = $ua->get_basic_credentials($realm, $uri, $isproxy);
 
-This is called by request() to retrieve credentials for documents
+This is called by L<LWP::UserAgent/request> to retrieve credentials for documents
 protected by Basic or Digest Authentication.  The arguments passed in
-is the $realm provided by the server, the $uri requested and a boolean
-flag to indicate if this is authentication against a proxy server.
+is the C<$realm> provided by the server, the C<$uri> requested and a
+C<boolean flag> to indicate if this is authentication against a proxy server.
 
 The method should return a username and password.  It should return an
 empty list to abort the authentication resolution attempt.  Subclasses
@@ -1885,21 +1904,21 @@ example of this can be found in C<lwp-request> program distributed
 with this library.
 
 The base implementation simply checks a set of pre-stored member
-variables, set up with the credentials() method.
+variables, set up with the L<LWP::UserAgent/credentials> method.
+
+=head2 progress
 
-=item $ua->progress( $status, $request_or_response )
+    my $prog = $ua->progress( $status, $request_or_response );
 
 This is called frequently as the response is received regardless of
-how the content is processed.  The method is called with $status
-"begin" at the start of processing the request and with $state "end"
-before the request method returns.  In between these $status will be
+how the content is processed.  The method is called with C<$status>
+"begin" at the start of processing the request and with C<$state> "end"
+before the request method returns.  In between these C<$status> will be
 the fraction of the response currently received or the string "tick"
 if the fraction can't be calculated.
 
-When $status is "begin" the second argument is the request object,
-otherwise it is the response object.
-
-=back
+When C<$status> is "begin" the second argument is the L<HTTP::Request> object,
+otherwise it is the L<HTTP::Response> object.
 
 =head1 SEE ALSO
 
@@ -1914,7 +1933,7 @@ and L<HTML::Form> for other ways to build request objects.
 See L<WWW::Mechanize> and L<WWW::Search> for examples of more
 specialized user agents based on L<LWP::UserAgent>.
 
-=head1 COPYRIGHT
+=head1 COPYRIGHT AND LICENSE
 
 Copyright 1995-2009 Gisle Aas.
 
index b12cc941d3a661c7265d6d0cb19110ceec5e08c3..d7c9789af8e3b271b4a35cc7f15f752c68b250b4 100644 (file)
@@ -3,7 +3,8 @@ use warnings;
 use Test::More;
 
 use LWP::UserAgent;
-plan tests => 10;
+use HTTP::Request ();
+plan tests => 4;
 
 # Prevent environment from interfering with test:
 delete $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME};
@@ -13,40 +14,63 @@ delete $ENV{PERL_LWP_SSL_CA_FILE};
 delete $ENV{PERL_LWP_SSL_CA_PATH};
 delete $ENV{PERL_LWP_ENV_PROXY};
 
-my $ua = LWP::UserAgent->new;
+# we can only use HTTP::Request >= 6.07
+my $ver = $HTTP::Request::VERSION || '6.00';
+my $ver_ok = eval {HTTP::Request->VERSION("6.07");};
+diag "Some tests for the PUT method can only be run on ";
+diag "HTTP::Request version 6.07 or higher.";
+diag "If your version isn't good enough, we'll skip those.";
+diag "Your version is $ver and that's ". ($ver_ok ? '' : 'not '). 'good enough';
 
 # default_header 'Content-Type' should be honored in POST/PUT
 # if the "Content => 'string'" form is used. Otherwise, x-www-form-urlencoded
 # will be used
-
+my $url = "http://www.example.com";
+my $ua = LWP::UserAgent->new;
 $ua->default_header('Content-Type' => 'application/json');
-
 $ua->proxy(http => "loopback:");
 $ua->agent("foo/0.1");
 
-my $url = "http://www.example.com";
-
 # These forms will all be x-www-form-urlencoded
-for my $call (qw(post put)) {
+subtest 'PUT x-www-form-urlencoded' => sub {
+    plan skip_all => "HTTP::Request version not high enough" unless $ver_ok;
+    plan tests => 4;
     for my $arg (
         [ { cat => 'dog' }             ],
         [ [ cat => 'dog' ]             ],
         [ Content => { cat => 'dog' }, ],
         [ Content => [ cat => 'dog' ], ],
     ) {
-        my $ucall = uc $call;
-
-        is ($ua->$call($url, @$arg)->content, <<"EOT", "$call @$arg");
-$ucall http://www.example.com
+        is ($ua->put($url, @$arg)->content, <<"EOT", "put @$arg");
+PUT http://www.example.com
 User-Agent: foo/0.1
 Content-Length: 7
 Content-Type: application/x-www-form-urlencoded
 
 cat=dog
 EOT
+    }
+};
+
+# These forms will all be x-www-form-urlencoded
+subtest 'POST x-www-form-urlencoded' => sub {
+    plan tests => 4;
+    for my $arg (
+        [ { cat => 'dog' }             ],
+        [ [ cat => 'dog' ]             ],
+        [ Content => { cat => 'dog' }, ],
+        [ Content => [ cat => 'dog' ], ],
+    ) {
+        is ($ua->post($url, @$arg)->content, <<"EOT", "post @$arg");
+POST http://www.example.com
+User-Agent: foo/0.1
+Content-Length: 7
+Content-Type: application/x-www-form-urlencoded
 
+cat=dog
+EOT
     }
-}
+};
 
 # These should all use the default
 for my $call (qw(post put)) {
@@ -64,4 +88,3 @@ Content-Type: application/json
 EOT
 
 }
-
index fdd5db24e7cbe772c92aff8c65b0f656a89a9226..dd1a5a7953d657f80524429d231002ac898a6374 100644 (file)
@@ -26,21 +26,21 @@ plan skip_all => 'All the modules we found were excluded from POD coverage test.
 plan tests => scalar @modules;
 
 my %trustme = (
-             'LWP::Protocol::http' => [
-                                      qr/^(?:hlist_remove|socket_class|socket_type)$/
-                                    ],
-             'LWP::Protocol::gopher' => [
-                                        qr/^(?:gopher2url|menu2html)$/
-                                      ],
+             'LWP::RobotUA' => [
+                               qr/^host_count$/
+                             ],
              'LWP::UserAgent' => [
                                  qr/^(?:run_handlers|send_request|use_alarm|use_eval)$/
                                ],
              'LWP::Protocol' => [
                                 qr/^(?:max_size|timeout)$/
                               ],
-             'LWP::RobotUA' => [
-                               qr/^host_count$/
-                             ]
+             'LWP::Protocol::http' => [
+                                      qr/^(?:hlist_remove|socket_class|socket_type)$/
+                                    ],
+             'LWP::Protocol::gopher' => [
+                                        qr/^(?:gopher2url|menu2html)$/
+                                      ]
            );
 
 my @also_private;
index c7049dff9643ec1304ae2600870ae2881df4f3db..a6a6e90cbce1d2f89c6df7664b1d28c6de9a7d3a 100644 (file)
@@ -4,7 +4,7 @@ use Test::More tests => 2;
 
 note 'Checking Changes';
 my $changes_file = 'Changes';
-my $newver = '6.21';
+my $newver = '6.22';
 my $trial_token = '-TRIAL';
 
 SKIP: {