Skip Menu |
 

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 20819
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: MARKSTOS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 5.805
Fixed in: (no value)



Subject: PATCH: HTTP::Status doesn't document how the methods correspond with the return codes
Download (untitled) / with headers
text/plain 119b
It wasn't documented how is_error, is_redirect, etc corresponded with the return codes. This patch fixes that. Mark
Subject: http-status.patch
Download http-status.patch
text/x-diff 1010b
6c6 < require 5.002; # becase we use prototypes --- > require 5.002; # because we use prototypes 126a127,128 > Informational Codes (is_info) > 130a133,134 > Success Codes (is_success) > 139a144,145 > Redirect Codes (is_redirect) > 147a154,155 > Client Error Codes (is_client_error is_error) > 169a178,179 > Server Error Codes (is_server_error is_error) > 195c205 < any content. --- > any content. See listing above for which are considered informational. 199c209 < Return TRUE if C<$code> is a I<Successful> status code. --- > Return TRUE if C<$code> is a I<Successful> status code. See listing above for which are considered successful. 205c215 < user agent in order to fulfill the request. --- > user agent in order to fulfill the request. See listing above for which are considered redirects. 210a221 > See listing above for which are considered errors. 217a229,230 > See listing above for which are considered client errors. > 225a239,240 > See listing above for which are considered server errors. >
Download (untitled) / with headers
text/plain 1.9k
I've now applied a simplified patch. --- a/lib/HTTP/Status.pm +++ b/lib/HTTP/Status.pm @@ -1,7 +1,7 @@ package HTTP::Status; use strict; -require 5.002; # becase we use prototypes +require 5.002; # because we use prototypes use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION); @@ -203,28 +203,28 @@ names above. If the $code is unknown, then C<undef> is returned. =item is_info( $code ) -Return TRUE if C<$code> is an I<Informational> status code. This +Return TRUE if C<$code> is an I<Informational> status code (1xx). This class of status code indicates a provisional response which can't have any content. =item is_success( $code ) -Return TRUE if C<$code> is a I<Successful> status code. +Return TRUE if C<$code> is a I<Successful> status code (2xx). =item is_redirect( $code ) -Return TRUE if C<$code> is a I<Redirection> status code. This class of +Return TRUE if C<$code> is a I<Redirection> status code (3xx). This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request. =item is_error( $code ) -Return TRUE if C<$code> is an I<Error> status code. The function +Return TRUE if C<$code> is an I<Error> status code (4xx or 5xx). The function return TRUE for both client error or a server error status codes. =item is_client_error( $code ) -Return TRUE if C<$code> is an I<Client Error> status code. This class +Return TRUE if C<$code> is an I<Client Error> status code (4xx). This class of status code is intended for cases in which the client seems to have erred. @@ -232,7 +232,7 @@ This function is B<not> exported by default. =item is_server_error( $code ) -Return TRUE if C<$code> is an I<Server Error> status code. This class +Return TRUE if C<$code> is an I<Server Error> status code (5xx). This class of status codes is intended for cases in which the server is aware that it has erred or is incapable of performing the request.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.