/usr/share/perl5/Role/REST/Client/Response.pm is in librole-rest-client-perl 0.22-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | package Role::REST::Client::Response;
$Role::REST::Client::Response::VERSION = '0.22';
use Moo;
use MooX::HandlesVia;
use Types::Standard qw(Str Int CodeRef InstanceOf);
has 'code' => (
isa => Int,
is => 'ro',
);
has 'response' => (
isa => InstanceOf['HTTP::Response'],
is => 'ro',
);
has 'error' => (
isa => Str,
is => 'ro',
predicate => 'failed',
);
has 'data_callback' => (
init_arg => 'data',
isa => CodeRef,
is => 'ro',
default => sub { sub { {} } },
handles_via => 'Code',
handles => { data => 'execute' },
);
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Role::REST::Client::Response - Response class for REST
=head1 VERSION
version 0.22
=head1 SYNOPSIS
my $res = Role::REST::Client::Response->new(
code => '200',
response => HTTP::Response->new(...),
error => 0,
data_callback => sub { sub { ... } },
);
=head1 ATTRIBUTES
=head2 code
HTTP status code of the request
=head2 response
L<HTTP::Response> object. Use this if you need more information than status and content.
=head2 error
The error description returned from the user agent when the HTTP status code is 500 or higher. More detail may be found
by calling C<< $res->response->content >>.
=head2 failed
True if the request didn't succeed.
=head2 data
The deserialized data. Returns an empty hashref if the response was unsuccessful.
=head1 BUGS
Please report any bugs or feature requests to bug-role-rest-client at rt.cpan.org, or through the
web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Role-REST-Client.
=head1 AUTHOR
Kaare Rasmussen <kaare at cpan dot org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Kaare Rasmussen.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
|