-
Notifications
You must be signed in to change notification settings - Fork 2
readme api
David E. Wheeler edited this page Apr 28, 2011
·
7 revisions
-
Name:
readme
-
Returns:
text/plain; charset=utf-8
-
URI Template Variables:
{dist}
,{version}
- Availability: Mirror Server, API Server
Returns the contents of the README
file for a distribution, if there is one.
This method requires that the distribution name and version be known; these
values can be retrieved from the following APIs:
Assuming you have retrieved the JSON document from the index API
and stored the data in the $table
hash, you can fetch the contents of the
README
file in version 1.1.0 of the "pair" distribution like so:
use URI::Template;
use HTTP::Tiny;
my $tmpl = URI::Template->new($table->{readme});
my $uri = $tmpl->process({
dist => 'pair',
version => '1.1.0',
});
my $req = HTTP::Tiny->new;
my $res = $req->get($uri);
say $res->{content};
If you have any questions about the PGXN Mirror and API Server APIs, please post them to the PGXN Users list. If you find any bugs in the API, please report them. To follow news about PGXN, subscribe to the blog and the Mastodon stream.