diff --git a/lib/REST/Client.pm b/lib/REST/Client.pm index b47b3b5..b16f818 100644 --- a/lib/REST/Client.pm +++ b/lib/REST/Client.pm @@ -445,6 +445,17 @@ sub responseHeader { return $self->{_res}->header($header); } +=head3 responseObject + +Return a L response object + +=cut + +sub responseObject { + my $self = shift; + return $self->{_res}; +} + =head3 responseXpath () A convienience wrapper that returns a L xpath context for the body content. Assumes the content is XML. diff --git a/t/basic.t b/t/basic.t index 0f42330..ef83cc7 100644 --- a/t/basic.t +++ b/t/basic.t @@ -3,6 +3,7 @@ use warnings; unshift @INC, "../lib"; +use Scalar::Util qw/blessed/; use Test::More; # Check testing prereqs @@ -119,6 +120,8 @@ SKIP: { ok(scalar($client->responseHeaders()), 'Header names available'); ok( $client->responseHeader('Client-Response-Num'), 'Can pull a header'); + is( blessed($client->responseObject()), 'HTTP::Response', 'HTTP::Response available'); + my $fn = "content_file_test"; $client->setContentFile( $fn ); $path = "/ok/" . time() . "/";