The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Net::OpenStack::Client::Response is an response class for Net::OpenStack.

Boolean logic is overloaded using _boolean method (as inverse of is_error).

Public methods

mkresponse

A Net::OpenStack::Client::Response factory

new

Create new response instance.

Options

data: (first) response content, possibly decoded
headers: hashref with reponse headers
error: an error (passed to mkerror).
result_path: passed to set_result to set the result attribute.
set_error

Set and return the error attribute using mkerror.

set_result

Set and return the result attribute based on the result_path.

The result_path is either

(absolute, starting with /) path-like string, indicating which subtree of the answer should be set as result attribute (default /).
anything else is considered a header (from the response headers).
result

Return the result attribute.

If result_path is passed (and defined), (re)set the result attribute first. (The default result path cannot be (re)set this way. Use set_result method for that).

is_error

Test if this is an error or not (based on error attribute).