OvhApi::Answer - Response to a request run with OvhApi.
OvhApi
my $Answer = $Api->get(path => '/me'); if ($Answer) { # Success: can fetch content and process my $content = $Answer->content; } else { # Request failed: stop here and retrieve the error my $error = $Answer->error; }
This module represents a response to a query run with OvhApi. It is build upon a HTTP::Request object.
HTTP::Request
There is only one constructor: new.
new
Its parameters are:
Parameter Mandatory Default Usage ------------ ------------ ---------- -------- response Yes - An HTTP::Response object return by LWP::UserAgent
Returns the content of the answer. This method will carp if the answer is an error.
carp
It takes no parameter.
Returns the error message of the answer, or an empty string if the answer is a success.
Forwards a call to HTTP::Response::is_error in the inner HTTP::Response of the answer. Returns true is the request was a success, false otherwise.
HTTP::Response::is_error
HTTP::Response
This method is used for the bool overload.
bool
Helper method which returns the boolean negation of isSuccess.
The guts of module are using: JSON.
JSON
Copyright (c) 2013, OVH SAS. All rights reserved.
This library is distributed under the terms of license.txt.
license.txt
To install Webservice::OVH, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Webservice::OVH
CPAN shell
perl -MCPAN -e shell install Webservice::OVH
For more information on module installation, please visit the detailed CPAN module installation guide.