summary refs log tree commit diff
diff options
context:
space:
mode:
authorTim Bunce <Tim.Bunce@pobox.com>2010-11-23 12:09:33 +0000
committerTim Bunce <Tim.Bunce@pobox.com>2010-11-23 12:09:33 +0000
commit764873681685d9b5513f8441a26156557e3951b3 (patch)
treed7bbf2338d5b07c5768042ffdfdac8ebf51cdd94
parentThrow exception by default if not is_success (but excepted takes precedence) (diff)
downloadnet-http-spore-764873681685d9b5513f8441a26156557e3951b3.tar.gz
Add is_success method to Net/HTTP/Spore/Response.pm
-rw-r--r--lib/Net/HTTP/Spore/Response.pm1
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;