add responseObject getter

This commit is contained in:
pru.mike 2018-08-03 00:18:20 +03:00 committed by Andreas K. Hüttel
parent 33753a8bdd
commit cb3f418c70
No known key found for this signature in database
GPG Key ID: 4C49F79E54D0A206
2 changed files with 14 additions and 0 deletions

View File

@ -445,6 +445,17 @@ sub responseHeader {
return $self->{_res}->header($header);
}
=head3 responseObject
Return a L<HTTP::Response> response object
=cut
sub responseObject {
my $self = shift;
return $self->{_res};
}
=head3 responseXpath ()
A convienience wrapper that returns a L<XML::LibXML> xpath context for the body content. Assumes the content is XML.

View File

@ -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() . "/";