NAME

WebService::XING::Response - XING API Response Class

DESCRIPTION

Most methods of WebService::XING return object instances of the WebService::XING::Response class, that contains HTTP status and header information besides the actual response.

OVERLOADING

A WebService::XING::Response object is overloaded with the follwing behaviour:

String context:
say $response;      # => "200 OK"

The HTTP status message ("code" . " " . "message"). Calls "as_string" behind the curtain.

Numeric context:
say "created" if $response == 201;

The HTTP status "code".

Boolean context:
$res = $xing->get_user_details or die $res;

Is true for "code" < 400, otherwise false. Calls "is_success" behind the curtain.

ATTRIBUTES

code

3-digit HTTP status code.

message

A human readable message, but not intended to be displayed to the user.

headers

A HTTP::Headers object. Never rely on this item, it is virtually only useful for debugging.

content

The (decoded) content.

METHODS

as_string

say $response->as_string;      # => "200 OK"

The HTTP status message ("code" . " " . "message").

is_success

$res->is_success or die $res->as_string;

Is true for "code" < 400, otherwise false.