-
-
07 Mar 2017 08:20:06 UTC
- Distribution: Net-Travis-API
- Module version: 0.002001
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (0)
- Testers (1134 / 0 / 0)
- Kwalitee
Bus factor: 0- 36.09% Coverage
- License: perl_5
- Perl: v5.10.0
- Activity
24 month- Tools
- Download (51.17KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
Why not adopt me?
This distribution is up for adoption! If you're interested then please contact the PAUSE module admins via email.NAME
Net::Travis::API::UA - Travis Specific User Agent that handles authorization
VERSION
version 0.002001
SYNOPSIS
use Net::Travis::API::UA; use Data::Dump qw( pp ); my $ua = Net::Travis::API::UA->new( http_prefix => 'https://api.travis-ci.org', # default authtokens => [ 'sometoken' ] # multiple supported, but it may not mean anything for travis ); my $result = $ua->get('/users'); if ( $result->content_type eq 'application/json' ) { print pp( $result->content_json ); } else { print pp( $result ); }
This module does a few things:
- 1. Wrap HTTP::Tiny
- 2. Assume you want to use relative URI's to the travis service
- 3. Inject Authorization tokens where possible.
All requests return
::Response
objects.METHODS
has_authtokens
A predicate that returns whether
authtokens
is set or notrequest
This method overrides
HTTP::Tiny
'srequest
method so as to augment all other methods inherited.This simply wraps all responses in a
Net::Travis::API::UA::Response
ATTRIBUTES
http_prefix
Optional.
Determines the base URI to use for relative URIs.
Defaults as
https://api.travis-ci.org
but should be changed if you're using their paid-for service.http_default_accept_headers
Optional.
Sets the default
Accept
headers to send to the Travis-CI service.Defaults to
application/vnd.travis-ci.2+json
as per the API documentation. Without this, the deprecated version 1 API will be used instead.authtokens
Optional.
If specified, determines a list of authentication tokens to pass with all requests.
json
Optional.
Defines a JSON decoder object.
AUTHOR
Kent Fredric <kentnl@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Net::Travis::API, copy and paste the appropriate command in to your terminal.
cpanm Net::Travis::API
perl -MCPAN -e shell install Net::Travis::API
For more information on module installation, please visit the detailed CPAN module installation guide.