Yuji Shimada > WWW-Google-ClientLogin-0.04 > WWW::Google::ClientLogin::Response

Download:
WWW-Google-ClientLogin-0.04.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

WWW::Google::ClientLogin::Response - Response Object

SYNOPSIS ^

  my $res = WWW::Google::ClientLogin::Response->new(
      is_success    => 1,
      code          => 200,
      message       => 'OK',
      http_response => $http_response_object,
      params        => { ... },
  );

DESCRIPTION ^

WWW::Google::ClientLogin::Response is a WWW::Google::ClientLogin internal class.

METHODS ^

new(%args)

Creates a new instance.

is_success()

  $res->is_success ? 1 : 0;

is_error()

  $res->is_error 1 : 0;

has_error()

Alias of is_error().

code()

HTTP Response code.

  say $res->code;

message()

HTTP message or ClientLogin error message

  say $res->message;

status_line()

Return value is a string that contains the code() and message().

  say $res->status_line; # eq say $res->code, ' ', $res->message;

http_response()

Original HTTP Response object.

  my $http_response = $res->http_response;
  say $http_response->as_string;

res()

Alias of http_response().

error_code()

Response error code. SEE ALSO http://code.google.com/intl/en/apis/accounts/docs/AuthForInstalledApps.html#Errors

  use WWW::Google::ClientLogin::Constants;
  if ($res->error_code eq BadAuthentication) {
      ...
  }

auth_token()

  say $res->auth_token;

sid()

  say $res->sid;

lsid()

  say $res->lsid;

is_captcha_required()

  $res->is_captcha_required ? 1 : 0;

captcha_token()

  my $captcha_token = $res->captcha_token;

captcha_url()

  my $captcha_url = $res->captcha_url;

params()

Response parameters in HASHREF

  say $res->params->{auth_token};

AUTHOR ^

xaicron <xaicron@cpan.org>

COPYRIGHT ^

Copyright 2011 - xaicron

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

syntax highlighting: