MetaCPAN::Client::Request - Object used for making requests to MetaCPAN
version 1.022000
$mcpan = MetaCPAN::Client->new( domain => 'localhost' );
What domain to use for all requests.
Default: api.metacpan.org.
$mcpan = MetaCPAN::Client->new( version => 'v0' );
What version of MetaCPAN should be used?
Default: v0.
my $mcpan = MetaCPAN::Client->new( base_url => 'https://localhost:9999/v2', );
Instead of overriding the base_url, you should override the domain and version. The base_url will be set appropriately automatically.
base_url
domain
version
Default: https://$domain/$version.
my $mcpan = MetaCPAN::Client->new( ua => HTTP::Tiny->new(...) );
The user agent object for running requests.
It must provide an interface that matches HTTP::Tiny. Explicitly:
Implement post()
Method post must be available that accepts a request URL and a hashref of options.
post
Implement get()
Method get must be available that accepts a request URL.
get
Return result hashref
Must return a result hashref which has key success and key content.
success
content
Default: HTTP::Tiny,
my $mcpan = MetaCPAN::Client->new( ua_args => [ agent => 'MyAgent' ], );
Arguments sent to the user agent.
Default: user agent string: MetaCPAN::Client/$version.
my $result = $mcpan->fetch('/release/Moose'); # with parameters my $more = $mcpan->fetch( '/release/Moose', { param => 'value' }, );
Fetches a path from MetaCPAN (post or get), and returns the decoded result.
Calls an Elastic Search query (using Search::Elasticsearch and returns an Search::Elasticsearch::Scroll scroller object.
Sawyer X <xsawyerx@cpan.org>
Mickey Nasriachi <mickey@cpan.org>
This software is copyright (c) 2016 by Sawyer X.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install MetaCPAN::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MetaCPAN::Client
CPAN shell
perl -MCPAN -e shell install MetaCPAN::Client
For more information on module installation, please visit the detailed CPAN module installation guide.