MT#17801 added NGCP::API::Client::Result->result() method

Change-Id: I439475ceb0da5e84b5c1cceac3c2dcdbb7cf1fd1
changes/49/5349/1
Kirill Solomko 9 years ago
parent ff1ecaaf00
commit 82a1be5c3e

@ -96,6 +96,15 @@ sub as_hash {
return from_json($self->content, { utf8 => 1 });
}
sub result {
my $self = shift;
my $location = $self->headers->header('Location') || '';
return $self->is_success
? sprintf "%s %s", $self->status_line, $location
: sprintf "%s %s", $self->status_line, $self->content;
}
1;
__END__
@ -184,6 +193,10 @@ Return: undef
Return: result as a hash reference
=head2 NGCP::API::Client::Result->result()
Return: return a result string based on the request success
=head1 BUGS AND LIMITATIONS
L<https://bugtracker.sipwise.com>

Loading…
Cancel
Save