diff options
author | Tim Bunce <Tim.Bunce@pobox.com> | 2010-11-23 12:09:33 +0000 |
---|---|---|
committer | Tim Bunce <Tim.Bunce@pobox.com> | 2010-11-23 12:09:33 +0000 |
commit | 764873681685d9b5513f8441a26156557e3951b3 (patch) | |
tree | d7bbf2338d5b07c5768042ffdfdac8ebf51cdd94 | |
parent | Throw exception by default if not is_success (but excepted takes precedence) (diff) | |
download | net-http-spore-764873681685d9b5513f8441a26156557e3951b3.tar.gz |
Add is_success method to Net/HTTP/Spore/Response.pm
-rw-r--r-- | lib/Net/HTTP/Spore/Response.pm | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Net/HTTP/Spore/Response.pm b/lib/Net/HTTP/Spore/Response.pm index b667332..0696d2b 100644 --- a/lib/Net/HTTP/Spore/Response.pm +++ b/lib/Net/HTTP/Spore/Response.pm @@ -26,6 +26,7 @@ sub env { shift->request->env } sub content_type { shift->headers->content_type(@_) } sub content_length { shift->headers->content_length(@_) } sub location { shift->header->header( 'Location' => @_ ) } +sub is_success { shift->status =~ /^2\d\d$/ } sub status { my $self = shift; |