Yandex::OAuth::Client - base class for any Yandex.API modules
use Yandex::OAuth::Client; my $client = Yandex::OAuth::Client->new(token => '************', endpoint => 'https://api-metrika.yandex.ru/'); my $client->get(['stat','user_vars'], { pretty => 1, # other params specified for resource }); # url converting to https://api-metrika.yandex.ru/stat/user_vars/?pretty=1
Yandex::OAuth::Client is base class for any Yandex.API modules Contains get, post, put, delete methods for queries to any APIs Yandex.
Looking for contributors for this and other Yandex.APIs
Require two arguments: token and endpoint. For module based on Yandex::OAuth::Client you can override atribute 'endpoint'
extends 'Yandex::OAuth::Client'; has '+endpoint' => ( is => 'ro', default => 'https://api-metrika.yandex.ru/', );
Send GET request.
$client->get(['stat','load']); # or full link. for example, when using "next" link from previous response $client->get('https://api-metrika.yandex.ru/stat/load/?pretty=1');
Send POST request.
$client->post(['counters'], { # query params }, { # body params });
Send PUT request.
$client->put(['counter', $counter_id], { # query params }, { # body params });
Send DELETE request.
$client->delete(['counter', $counter_id]);
Copyright (C) Andrey Kuzmin.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Andrey Kuzmin <chipsoid@cpan.org>
To install Yandex::OAuth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Yandex::OAuth
CPAN shell
perl -MCPAN -e shell install Yandex::OAuth
For more information on module installation, please visit the detailed CPAN module installation guide.