UserAgent

NAME

WebService::FootballData::Facade::UserAgent - A user agent facade

SYNOPSIS


use WebService::FootballData::Facade::UserAgent;

my $ua = WebService::FootballData::Facade::UserAgent.new;

my $leagues_json = $ua.get: 'soccerseasons';

DESCRIPTION

A user agent facade.

METHODS

get

$request.get: 'http://api.football-data.org/v1/teams/65/fixtures';
    $request.get: 'http://api.football-data.org/v1/teams/65/fixtures?season=2014', :X-Auth-Token(12345);

Takes:

  • A URL, of type Str.

  • Optional Named arguments as header fields.

Returns the response, of type Str.

ERRORS

HTTP::UserAgent module is used with exception throwing enabled. So exceptions will be thrown in case of non-existent resources, out of range values, etc. See http://modules.perl6.org/dist/HTTP::UserAgent.

When an exception of type X::HTTP::Response is caught, and the response received from football-data.org contains an error message, an attribute named footballdata_error will be added to the exception containing that error message.

AUTHOR

Siavash Askari Nasr - http://ciavash.name/

COPYRIGHT AND LICENSE

Copyright Ā© 2016 Siavash Askari Nasr

This file is part of WebService::FootballData.

WebService::FootballData is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

WebService::FootballData is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with WebService::FootballData. If not, see <http://www.gnu.org/licenses/>.

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.