NAME
Net::API::CPAN::Mock - Meta CPAN API
SYNOPSIS
use Net::API::CPAN::Mock;
my $this = Net::API::CPAN::Mock->new(
pretty => 1,
openapi => '/path/to/cpan-openapi-specs.json',
) || die( Net::API::CPAN::Mock->error, "\n" );
$mock->bind || die( $mock->error );
$mock->start || die( $mock->error );
my $url = $mock->url_base;
# perform tests by connecting to the mock MetaCPAN API at $url
$mock->stop;
VERSION
v0.1.0
DESCRIPTION
This provides a mock MetaCPAN API server based on the original mock server idea in Test::HTTP::MockServer
It emulates all the known endpoints of the CPAN API, and endeavours to mimic its responses.
It provides sample data for all endpoints. Those data are based on real CPAN modules, but have been completely anonymised using fake names and fake e-mail addresses.
CONSTRUCTOR
new
This instantiates a new Net::API::CPAN::Mock object. It accepts the following options as an hash or hash reference.
It returns the new object upon success, or upon error, sets an error and returns undef in scalar context, or an empty list in list context.
checksumOpenAPI specifications file checksum for caching. This is set automatically by load_specs
endpointsOpenAPI resulting endpoints we derived from the specs
hostThe
hostto use when starting the mock CPAN API server.openapiThis is the filepath to the OpenAPI specifications file.
portThe
portto use when starting the mock CPAN API server.prettyBoolean. If true, the
JSONdata returned by the mock server will be in a human-readable format.schemaThe OpenAPI resulting schema we derived from the specs.
METHODS
bind
This creates a socket, and binds it to the host and port
If none provided, the host is set to 127.0.0.1and the port is randomly generated.
Once done, it sets the host and port and socket values to be accessible with their respective method.
It returns the current object upon success, or, upon error, sets an error and returns undef in scalar context, or an empty list in list context.
data
my $data = $self->data;
Read-only. This returns the test data as an hash reference. The test data are stored in $Net::API::CPAN::Mock::TEST_DATA
endpoints
Sets or gets the hash reference of endpoints derived from the specs analysed in load_specs
This returns an hash object, or undef if nothing was set yet.
host
When used as a mutator, i.e. setting a value, this sets the host to use when starting the server.
In accessor mode, this ensures the socket is bound to the specified host and port.
By default, the value used is 127.0.0.1
This returns the current host value.
json
Sets or gets the JSON object.
load_specs
This takes a file path to an OpenAPI specifications, and will load its enclosed endpoints, schema and all specifications that will be used to run the mock CPAN API server.
The result is cached, so it can be re-called safely. If the OpenAPI specifications have been changed, the next call to load_specs will have it re-load the file.
It sets the value for specs, sets the MD5 checksum for the OpenAPI specifications file, and the hash reference of endpoints.
It returns the current object upon success, or, upon error, sets an error and returns undef in scalar context, or an empty list in list context.
pid
Sets or gets the process ID for this mock CPAN API server.
Returns a regular number or undef if nothing was set yet.
port
When used as a mutator, i.e. setting a value, this sets the port to use when starting the server.
In accessor mode, this ensures the socket is bound to the specified host and port.
By default, the value used is a random integer.
This returns the current host value.
pretty
$mock->pretty(1);
my $bool = $mock->pretty;
Sets or gets the boolean value of whether the JSON data returned by the mock server will be in a human-readable format.
Defaults to false.
socket
Sets or gets the server socket value.
Returns an IO::Socket filehandle when set, or undef otherwise.
specs
The OpenAPI JSON specifications as perl hash reference. This is set upon loading by load_specs
start
Starts the mock CPAN API server, forks and returns the current object upon success, or, upon error, sets an error and returns undef in scalar context, or an empty list in list context.
The child process whose pid can be accessed with "pid" in pid goes on waiting for connections.
stop
Stop the mock CPAN API server, and returns the killed process pid
url_base
my $uri = $mock->url_base; # http://127.0.0.1:1234
Read-only. Based on the host and port set, this returns an URI object representing the base HTTP URI for all endpoints.
ENDPOINTS
The following are the endpoints supported by MetaCPAN REST API:
/v1/authorcurl https://fastapi.metacpan.org/v1/author?q=OALDERS curl -XPOST https://fastapi.metacpan.org/v1/author -H 'Content-Type: application/json; charset=utf-8' --data-binary \@- <<EOT { "query": { "filtered": { "query": { "match_all":{} }, "filter": { "and": [ { "term": { "pauseid": "OALDERS" } } ] } }} } EOTGETorPOSTretrieves authors information details using a simple search/v1/author/_mappingcurl https://fastapi.metacpan.org/v1/author/_mapping curl -XPOST https://fastapi.metacpan.org/v1/author/_mappingGETorPOSTreturns the available fields for the author object/v1/author/_searchcurl https://fastapi.metacpan.org/v1/author/_search?from=10&q=Tokyo&size=10 curl -XPOST https://fastapi.metacpan.org/v1/author/_search -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "query" : { "filtered" : { "filter" : { "and" : [ { "term" : { "city" : "Tokyo" } } ] }, "query" : { "match_all" : {} } } } } EOTGETorPOSTreturns the result set for the author search/v1/author/_search/scrollGETorPOSTreturns the result set for the author search andDELETEclear a scroll/v1/author/by_idscurl https://fastapi.metacpan.org/v1/author/by_ids?id=OALDERS&id=JDEGUEST curl -XPOST https://fastapi.metacpan.org/v1/author/by_ids -H 'Content-Type: application/json; charset=utf-8' -d '{"id" : ["OALDERS", "JDEGUEST"]}'GETorPOSTretrieves author information details for the specified pause IDs/v1/author/by_prefix/{prefix}curl https://fastapi.metacpan.org/v1/author/by_prefix/OAL curl -XPOST https://fastapi.metacpan.org/v1/author/by_prefix/O?from=40&size=20'GETorPOSTretrieves authors information details using the initial characters of their pause ID/v1/author/by_usercurl https://fastapi.metacpan.org/v1/author/by_user?user=oa-cmsLWTTOALauLxve1LA&user=2n2yGvQ4QxenVpSzkkTitQ curl -XPOST https://fastapi.metacpan.org/v1/author/by_user -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "user" : [ "oa-cmsLWTTOALauLxve1LA", "2n2yGvQ4QxenVpSzkkTitQ" ] } EOTGETorPOSTretrieves authors information details using their user ID/v1/author/by_user/{user}curl https://fastapi.metacpan.org/v1/author/by_user/FepgBJBZQ8u92eG_TcyIGQ curl -XPOST https://fastapi.metacpan.org/v1/author/by_user/FepgBJBZQ8u92eG_TcyIGQGETorPOSTretrieves a author information details using his or her user ID/v1/author/{author}curl https://fastapi.metacpan.org/v1/author/OALDERS?join=release curl -XPOST https://fastapi.metacpan.org/v1/author/OALDERSGETorPOSTretrieves an author information details/v1/changes/by_releasescurl https://fastapi.metacpan.org/v1/changes/by_releases?release=OALDERS%2FHTTP-Message-6.37&release=JDEGUEST%2FModule-Generic-v0.30.1 curl -XPOST https://fastapi.metacpan.org/v1/changes/by_releases -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "release" : [ "OALDERS/HTTP-Message-6.37", "JDEGUEST/Module-Generic-v0.30.1" ] } EOTGETorPOSTretrieves one or more distribution Changes file details using author and release information/v1/changes/{author}/{release}curl https://fastapi.metacpan.org/v1/changes/OALDERS/HTTP-Message-6.36 curl -XPOST https://fastapi.metacpan.org/v1/changes/OALDERS/HTTP-Message-6.36GETorPOSTretrieves a Changes file details based on the specified release/v1/changes/{distribution}curl https://fastapi.metacpan.org/v1/changes/HTTP-Message curl -XPOST https://fastapi.metacpan.org/v1/changes/HTTP-MessageGETorPOSTretrieves a Changes file details based on the latest release of the specified distribution/v1/contributor/_mappingcurl https://fastapi.metacpan.org/v1/contributor/_mapping curl -XPOST https://fastapi.metacpan.org/v1/contributor/_mappingGETorPOSTreturns the available fields for the contributor object/v1/contributor/by_pauseid/{author}curl https://fastapi.metacpan.org/v1/contributor/by_pauseid/OALDERS curl -XPOST https://fastapi.metacpan.org/v1/contributor/by_pauseid/OALDERSGETorPOSTretrieves a list of module contributed to by the specified Pause ID/v1/contributor/{author}/{release}curl https://fastapi.metacpan.org/v1/contributor/OALDERS/HTTP-Message-6.37 curl -XPOST https://fastapi.metacpan.org/v1/contributor/OALDERS/HTTP-Message-6.37GETorPOSTretrieves a list of release contributors details/v1/cover/{release}curl https://fastapi.metacpan.org/v1/cover/HTTP-Message-6.37 curl -XPOST https://fastapi.metacpan.org/v1/cover/HTTP-Message-6.37GETorPOSTretrieves a module cover details/v1/cvecurl https://fastapi.metacpan.org/v1/cve curl -XPOST https://fastapi.metacpan.org/v1/cveGETorPOSTretrieves CVE (Common Vulnerabilities & Exposures) information details/v1/cve/dist/{distribution}curl https://fastapi.metacpan.org/v1/cve/dist/HTTP-Message curl -XPOST https://fastapi.metacpan.org/v1/cve/dist/HTTP-MessageGETorPOSTretrieves Distribution CVE (Common Vulnerabilities & Exposures) information details/v1/cve/release/{author}/{release}curl https://fastapi.metacpan.org/v1/cve/release/OALDERS/HTTP-Message-6.36 curl -XPOST https://fastapi.metacpan.org/v1/cve/release/OALDERS/HTTP-Message-6.36GETorPOSTretrieves Release CVE (Common Vulnerabilities & Exposures) information details/v1/cve/{cpanid}curl https://fastapi.metacpan.org/v1/cve/OALDERS curl -XPOST https://fastapi.metacpan.org/v1/cve/OALDERSGETorPOSTretrieves CPAN ID CVE (Common Vulnerabilities & Exposures) information details/v1/diff/file/{file1}/{file2}curl https://fastapi.metacpan.org/v1/diff/file/AcREzFgg3ExIrFTURa0QJfn8nto/Ies7Ysw0GjCxUU6Wj_WzI9s8ysU curl -XPOST https://fastapi.metacpan.org/v1/diff/file/AcREzFgg3ExIrFTURa0QJfn8nto/Ies7Ysw0GjCxUU6Wj_WzI9s8ysUGETorPOSTretrieves a diff of two files/v1/diff/release/{author1}/{release1}/{author2}/{release2}curl https://fastapi.metacpan.org/v1/diff/release/OALDERS/HTTP-Message-6.35/OALDERS/HTTP-Message-6.36 curl -XPOST https://fastapi.metacpan.org/v1/diff/release/OALDERS/HTTP-Message-6.35/OALDERS/HTTP-Message-6.36GETorPOSTretrieves a diff of two releases/v1/diff/release/{distribution}curl https://fastapi.metacpan.org/v1/diff/release/HTTP-Message curl -XPOST https://fastapi.metacpan.org/v1/diff/release/HTTP-MessageGETorPOSTretrieves a diff of the latest release and its previous version/v1/distributioncurl https://fastapi.metacpan.org/v1/distribution?from=10&q=HTTP&size=10 curl -XPOST https://fastapi.metacpan.org/v1/distribution -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "query" : { "regexp" : { "name" : "HTTP.*" } } } EOTGETorPOSTretrieves distributions information details/v1/distribution/_mappingcurl https://fastapi.metacpan.org/v1/distribution/_mapping curl -XPOST https://fastapi.metacpan.org/v1/distribution/_mappingGETorPOSTreturns the available fields for the distribution object/v1/distribution/_searchcurl https://fastapi.metacpan.org/v1/distribution/_search?q=HTTP.*&size=10 curl -XPOST https://fastapi.metacpan.org/v1/distribution/_search -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "query" : { "regexp" : { "name" : "HTTP.*" } } } EOTGETorPOSTreturns the result set for the distribution search/v1/distribution/_search/scrollGETorPOSTreturns the result set for the scroll search andDELETEclear a scroll/v1/distribution/rivercurl https://fastapi.metacpan.org/v1/distribution/river?distribution=HTTP-Message&distribution=Module-Generic curl -XPOST https://fastapi.metacpan.org/v1/distribution/river -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "distribution" : [ "HTTP-Message", "Module-Generic" ] } EOTGETorPOSTreturns the river of specified distributions/v1/distribution/river/{distribution}curl https://fastapi.metacpan.org/v1/distribution/river/HTTP-Message curl -XPOST https://fastapi.metacpan.org/v1/distribution/river/HTTP-MessageGETorPOSTreturns the river of a specific distribution/v1/distribution/{distribution}curl https://fastapi.metacpan.org/v1/distribution/HTTP-Message curl -XPOST https://fastapi.metacpan.org/v1/distribution/HTTP-MessageGETorPOSTretrieves the specified distribution latest release information/v1/download_url/{module}curl https://fastapi.metacpan.org/v1/download_url/HTTP::Message curl -XPOST https://fastapi.metacpan.org/v1/download_url/HTTP::MessageGETorPOSTretrieves a download URL for a given module. The/download_urlendpoint exists specifically for thecpanmclient. It takes a module name with an optional version (or range of versions) and an optionaldevflag (for development releases) and returns adownload_urlas well as some other helpful info.Obviously anyone can use this endpoint, but we'll only consider changes to this endpoint after considering how
cpanmmight be affected/v1/favoritecurl https://fastapi.metacpan.org/v1/favorite?q=HTTP&size=10 curl -XPOST https://fastapi.metacpan.org/v1/favorite -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "query" : { "regexp" : { "release" : "HTTP.*" } } } EOTGETorPOSTretrieves favorites information details/v1/favorite/_mappingGETorPOSTreturns the available fields for the favorite object/v1/favorite/_searchcurl https://fastapi.metacpan.org/v1/favorite/_search?from=40&q=HTTP&size=20 curl -XPOST https://fastapi.metacpan.org/v1/favorite/_search -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "from" : 40, "query" : { "regexp" : { "distribution" : "HTTP.*" } }, "size" : 20 } EOTGETorPOSTreturns the result set for the favorite search/v1/favorite/_search/scrollGETorPOSTreturns the result set for the favorite search andDELETEclear a scroll/v1/favorite/agg_by_distributionscurl https://fastapi.metacpan.org/v1/favorite/agg_by_distributions?distribution=HTTP-Message&distribution=DBI curl -XPOST https://fastapi.metacpan.org/v1/favorite/agg_by_distributions -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "distribution" : [ "HTTP-Message", "DBI" ] } EOTGETorPOSTretrieves favorites agregate by distributions/v1/favorite/by_user/{user}curl https://fastapi.metacpan.org/v1/favorite/by_user/q_15sjOkRminDY93g9DuZQ curl -XPOST https://fastapi.metacpan.org/v1/favorite/by_user/q_15sjOkRminDY93g9DuZQGETorPOSTretrieves user favorites information details/v1/favorite/leaderboardcurl https://fastapi.metacpan.org/v1/favorite/leaderboard curl -XPOST https://fastapi.metacpan.org/v1/favorite/leaderboardGETorPOSTretrieves top favorite distributions (leaderboard)/v1/favorite/recentcurl https://fastapi.metacpan.org/v1/favorite/recent?page=10&size=10 curl -XPOST https://fastapi.metacpan.org/v1/favorite/recent -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "page" : 10, "size" : 10 } EOTGETorPOSTretrieves list of recent favorite distributions/v1/favorite/users_by_distribution/{distribution}curl https://fastapi.metacpan.org/v1/favorite/users_by_distribution/HTTP-Message curl -XPOST https://fastapi.metacpan.org/v1/favorite/users_by_distribution/HTTP-MessageGETorPOSTretrieves list of users who favorited a distribution/v1/favorite/{user}/{distribution}curl https://fastapi.metacpan.org/v1/favorite/q_15sjOkRminDY93g9DuZQ/DBI curl -XPOST https://fastapi.metacpan.org/v1/favorite/q_15sjOkRminDY93g9DuZQ/DBIGETorPOSTretrieves favorites information details for a specific distribution/v1/filecurl https://fastapi.metacpan.org/v1/file?from=40&q=HTTP&size=20 curl -XPOST https://fastapi.metacpan.org/v1/file -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "from" : 40, "query" : { "regexp" : { "release" : "HTTP.*" } }, "size" : 20 } EOTGETorPOSTqueries files information details using simple search/v1/file/_mappingGETorPOSTreturns the available fields for the file object/v1/file/_searchcurl https://fastapi.metacpan.org/v1/file/_search?from=40&q=HTTP&size=20 curl -XPOST https://fastapi.metacpan.org/v1/file/_search -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "from" : 40, "query" : { "regexp" : { "path" : ".*HTTP.*" } }, "size" : 20 } EOTGETorPOSTreturns the result set for the file search/v1/file/_search/scrollGETorPOSTreturns the result set for the file search andDELETEclear a scroll/v1/file/dir/{path}curl https://fastapi.metacpan.org/v1/file/dir/OALDERS/HTTP-Message-6.36/lib/HTTP curl -XPOST https://fastapi.metacpan.org/v1/file/dir/OALDERS/HTTP-Message-6.36/lib/HTTPGETorPOSTretrieves a specific release directory content/v1/file/{author}/{release}/{path}curl https://fastapi.metacpan.org/v1/file/OALDERS/HTTP-Message-6.36/lib/HTTP/Message.pm curl -XPOST https://fastapi.metacpan.org/v1/file/OALDERS/HTTP-Message-6.36/lib/HTTP/Message.pmGETorPOSTretrieves a file information details specified by its release and file path/v1/login/indexcurl https://fastapi.metacpan.org/v1/login/index curl -XPOST https://fastapi.metacpan.org/v1/login/indexGETorPOSTreturns a login HTML page/v1/mirrorcurl https://fastapi.metacpan.org/v1/mirror curl -XPOST https://fastapi.metacpan.org/v1/mirrorGETorPOSTreturns amirrorsobject containing a list ofmirrorobjects. Currently, the API only returns one mirror, because CPAN now uses CDN instead of mirrors/v1/mirror/searchcurl https://fastapi.metacpan.org/v1/mirror/search?from=0&q=CPAN&size=20 curl -XPOST https://fastapi.metacpan.org/v1/mirror/search -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "from" : 0, "query" : { "regexp" : { "path" : ".*HTTP.*" } }, "size" : 20 } EOTGETorPOSTreturns amirrorsobject containing a list ofmirrorobjects. Currently, the API only returns one mirror, because CPAN now uses CDN instead of mirrors/v1/modulecurl https://fastapi.metacpan.org/v1/module?from=40&q=HTTP&size=20 curl -XPOST https://fastapi.metacpan.org/v1/module -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "from" : 40, "query" : { "regexp" : { "name" : "HTTP.*" } }, "size" : 20 } EOTGETorPOSTqueries modules information details using simple search/v1/module/_mappingGETorPOSTreturns the available fields for the module object/v1/module/_searchcurl https://fastapi.metacpan.org/v1/module/_search?from=40&q=HTTP&size=20 curl -XPOST https://fastapi.metacpan.org/v1/module/_search -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "from" : 40, "query" : { "regexp" : { "path" : ".*HTTP.*" } }, "size" : 20 } EOTGETorPOSTreturns the result set for the module search/v1/module/_search/scrollGETorPOSTreturns the result set for the module search andDELETEclear a scroll/v1/module/{module}curl https://fastapi.metacpan.org/v1/module/HTTP::Message curl -XPOST https://fastapi.metacpan.org/v1/module/HTTP::MessageGETorPOSTreturns the correspondingfileof the latest version of themodule. Considering that HTTP-Message-6.37 is the latest release, the result of /module/HTTP::Message is the same as /file/OALDERS/HTTP-Message-6.37/lib/HTTP/Message.pm/v1/packagecurl https://fastapi.metacpan.org/v1/package?from=40&q=HTTP&size=20 curl -XPOST https://fastapi.metacpan.org/v1/package -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "from" : 40, "query" : { "regexp" : { "module_name" : "HTTP.*" } }, "size" : 20 } EOTGETorPOSTqueries packages information details using simple search/v1/package/modules/{distribution}curl https://fastapi.metacpan.org/v1/package/modules/HTTP-Message curl -XPOST https://fastapi.metacpan.org/v1/package/modules/HTTP-MessageGETorPOSTretrieves the list of a distribution packages/v1/package/{module}curl https://fastapi.metacpan.org/v1/package/HTTP::Message curl -XPOST https://fastapi.metacpan.org/v1/package/HTTP::MessageGETorPOSTretrieves the latest release and package information for the specifiedmodule/v1/permissioncurl https://fastapi.metacpan.org/v1/permission?from=40&q=HTTP&size=20 curl -XPOST https://fastapi.metacpan.org/v1/permission -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "from" : 40, "query" : { "regexp" : { "module_name" : "HTTP.*" } }, "size" : 20 } EOTGETorPOSTqueries permissions information details using simple search/v1/permission/by_author/{author}curl https://fastapi.metacpan.org/v1/permission/by_author/OALDERS?from=40&q=HTTP&size=20 curl -XPOST https://fastapi.metacpan.org/v1/permission/by_author/OALDERS -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "from" : 40, "query" : { "regexp" : { "module_name" : "HTTP.*" } }, "size" : 20 } EOTGETorPOSTretrieves permission information details for the specified author/v1/permission/by_modulecurl https://fastapi.metacpan.org/v1/permission/by_module?module=HTTP%3A%3AMessage&module=Nice%3A%3ATry curl -XPOST https://fastapi.metacpan.org/v1/permission/by_module -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "module" : [ "HTTP::Message", "Nice::Try" ] } EOTGETorPOSTretrieves permission information details for the specified modules/v1/permission/by_module/{module}curl https://fastapi.metacpan.org/v1/permission/by_module/HTTP::Message curl -XPOST https://fastapi.metacpan.org/v1/permission/by_module/HTTP::MessageGETorPOSTretrieves permission information details for the specified module/v1/permission/{module}curl https://fastapi.metacpan.org/v1/permission/HTTP::Message curl -XPOST https://fastapi.metacpan.org/v1/permission/HTTP::MessageGETorPOSTreturns the correspondingpermissionfor the specifiedmodule/v1/pod/{author}/{release}/{path}curl https://fastapi.metacpan.org/v1/pod/OALDERS/HTTP-Message-6.36/lib/HTTP/Message.pm?content-type=text/x-markdown curl -XPOST https://fastapi.metacpan.org/v1/pod/OALDERS/HTTP-Message-6.36/lib/HTTP/Message.pm?content-type=text/x-markdownGETorPOSTreturns the POD of the given module in the specified release. You can change the output format by either passing acontent-typequery parameter (e.g. /pod/HTTP-Message?content-type=text/plain or by adding anAcceptheader to the HTTP request. Valid content types are:text/html (default)
text/plain
text/x-pod
text/x-markdown
/v1/pod/{module}curl https://fastapi.metacpan.org/v1/pod/HTTP::Message?content-type=text/plain curl -XPOST https://fastapi.metacpan.org/v1/pod/HTTP::Message?content-type=text/plainGETorPOSTreturns the POD of the given module. You can change the output format by either passing acontent-typequery parameter (e.g. /pod/HTTP-Message?content-type=text/plain or by adding anAcceptheader to the HTTP request. Valid content types are:text/html (default)
text/plain
text/x-pod
text/x-markdown
/v1/pod_rendercurl https://fastapi.metacpan.org/v1/pod_render?pod=%3Dencoding+utf-8%0A%0A%3Dhead1+Hello+World%0A%0ASomething+here%0A%0A%3Doops%0A%0A%3Dcut%0A curl -XPOST https://fastapi.metacpan.org/v1/pod_render?pod=%3Dencoding+utf-8%0A%0A%3Dhead1+Hello+World%0A%0ASomething+here%0A%0A%3Doops%0A%0A%3Dcut%0AGETorPOSTtakes some POD data and check for errors. It returns the POD provided in formatted plan text/v1/ratingcurl https://fastapi.metacpan.org/v1/rating?from=40&q=HTTP&size=20 curl -XPOST https://fastapi.metacpan.org/v1/rating -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "from" : 40, "query" : { "regexp" : { "distribution" : "HTTP.*" } }, "size" : 20 } EOTGETorPOSTqueries ratings information details using simple search/v1/rating/_mappingGETorPOSTreturns the available fields for the rating object/v1/rating/_searchcurl https://fastapi.metacpan.org/v1/rating/_search?from=40&q=HTTP&size=20 curl -XPOST https://fastapi.metacpan.org/v1/rating/_search -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "from" : 40, "query" : { "regexp" : { "distribution" : ".*HTTP.*" } }, "size" : 20 } EOTGETorPOSTreturns the result set for the rating search/v1/rating/_search/scrollGETorPOSTreturns the result set for the rating search andDELETEclear a scroll/v1/rating/by_distributionscurl https://fastapi.metacpan.org/v1/rating/by_distributions?distribution=HTTP-Tiny curl -XPOST https://fastapi.metacpan.org/v1/rating/by_distributions -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "distribution" : "HTTP-Tiny" }GETorPOSTretrieves rating informations details for the specified distributions/v1/releasecurl https://fastapi.metacpan.org/v1/release?from=40&q=HTTP&size=20 curl -XPOST https://fastapi.metacpan.org/v1/release -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "from" : 40, "query" : { "regexp" : { "distribution" : "HTTP.*" } }, "size" : 20 } EOTGETorPOSTqueries releases information details using simple search/v1/release/_mappingGETorPOSTreturns the available fields for the release object/v1/release/_searchcurl https://fastapi.metacpan.org/v1/release/_search?from=40&q=HTTP&size=20 curl -XPOST https://fastapi.metacpan.org/v1/release/_search -H 'Content-Type: application/json; charset=utf-8' --data-binary @- <<EOT { "from" : 40, "query" : { "regexp" : { "name" : ".*HTTP.*" } }, "size" : 20 } EOTGETorPOSTreturns the result set for the release search/v1/release/_search/scrollGETorPOSTreturns the result set for the release search andDELETEclear a scroll/v1/release/all_by_author/{author}curl https://fastapi.metacpan.org/v1/release/all_by_author/OALDERS?page=2&page_size=100 curl -XPOST https://fastapi.metacpan.org/v1/release/all_by_author/OALDERS?page=2&page_size=100GETorPOSTget all releases by the specified author/v1/release/by_author/{author}curl https://fastapi.metacpan.org/v1/release/by_author/OALDERS curl -XPOST https://fastapi.metacpan.org/v1/release/by_author/OALDERSGETorPOSTget releases by a specified author/v1/release/contributors/{author}/{release}curl https://fastapi.metacpan.org/v1/release/contributors/OALDERS/HTTP-Message-6.36 curl -XPOST https://fastapi.metacpan.org/v1/release/contributors/OALDERS/HTTP-Message-6.36GETorPOSTretrieves the list of contributors for the specified release/v1/release/files_by_category/{author}/{release}curl https://fastapi.metacpan.org/v1/release/files_by_category/OALDERS/HTTP-Message-6.36 curl -XPOST https://fastapi.metacpan.org/v1/release/files_by_category/OALDERS/HTTP-Message-6.36GETorPOSTretrieves the list of release key files by category/v1/release/interesting_files/{author}/{release}curl https://fastapi.metacpan.org/v1/release/interesting_files/OALDERS/HTTP-Message-6.36 curl -XPOST https://fastapi.metacpan.org/v1/release/interesting_files/OALDERS/HTTP-Message-6.36GETorPOSTretrieves the list of interesting files for the specified release/v1/release/latest_by_author/{author}curl https://fastapi.metacpan.org/v1/release/latest_by_author/OALDERS curl -XPOST https://fastapi.metacpan.org/v1/release/latest_by_author/OALDERSGETorPOSTget latest releases by the specified author/v1/release/latest_by_distribution/{distribution}curl https://fastapi.metacpan.org/v1/release/latest_by_distribution/HTTP-Message curl -XPOST https://fastapi.metacpan.org/v1/release/latest_by_distribution/HTTP-MessageGETorPOSTget latest releases for a specified distribution/v1/release/modules/{author}/{release}curl https://fastapi.metacpan.org/v1/release/modules/OALDERS/HTTP-Message-6.36 curl -XPOST https://fastapi.metacpan.org/v1/release/modules/OALDERS/HTTP-Message-6.36GETorPOSTretrieves the list of modules in the specified release/v1/release/recentcurl https://fastapi.metacpan.org/v1/release/recent curl -XPOST https://fastapi.metacpan.org/v1/release/recentGETorPOSTget recent releases/v1/release/top_uploaderscurl https://fastapi.metacpan.org/v1/release/top_uploaders curl -XPOST https://fastapi.metacpan.org/v1/release/top_uploadersGETorPOSTget top release uploaders/v1/release/versions/{distribution}curl https://fastapi.metacpan.org/v1/release/versions/HTTP-Message curl -XPOST https://fastapi.metacpan.org/v1/release/versions/HTTP-MessageGETorPOSTget all releases by versions for the specified distribution/v1/release/{author}/{release}curl https://fastapi.metacpan.org/v1/release/OALDERS/HTTP-Message-6.36 curl -XPOST https://fastapi.metacpan.org/v1/release/OALDERS/HTTP-Message-6.36GETorPOSTretrieves a distribution release information details. This/releaseendpoint accepts the name of anauthorand the name of therelease(e.g. /release/DOY/OALDERS/HTTP-Message-6.37, which returns the most recent release of the distribution/v1/release/{distribution}curl https://fastapi.metacpan.org/v1/release/HTTP-Message curl -XPOST https://fastapi.metacpan.org/v1/release/HTTP-MessageGETorPOSTretrieves the latest distribution release information details. The/releaseendpoint accepts either the name of adistribution(e.g. /release/HTTP-Message, which returns the most recent release of the distribution/v1/reverse_dependencies/dist/{distribution}curl https://fastapi.metacpan.org/v1/reverse_dependencies/dist/HTTP-Message curl -XPOST https://fastapi.metacpan.org/v1/reverse_dependencies/dist/HTTP-MessageGETorPOSTreturns a list of all the modules who depend on the specified distribution.`/v1/reverse_dependencies/module/{module}curl https://fastapi.metacpan.org/v1/reverse_dependencies/module/HTTP::Message curl -XPOST https://fastapi.metacpan.org/v1/reverse_dependencies/module/HTTP::MessageGETorPOSTreturns a list of all the modules who depend on the specified module/v1/searchGETorPOSTreturns result set based on the search query/v1/search/autocompleteGETorPOSTreturns result set based on the autocomplete search query/v1/search/autocomplete/suggestGETorPOSTreturns suggested result set based on the autocomplete search query.`/v1/search/firstGETorPOSTperform API search and return the first result (I'm Feeling Lucky)/v1/search/webGETorPOSTperform API search in the same fashion as the Web UI/v1/source/{author}/{release}/{path}curl https://fastapi.metacpan.org/v1/source/OALDERS/HTTP-Message-6.36/lib/HTTP/Message.pm curl -XPOST https://fastapi.metacpan.org/v1/source/OALDERS/HTTP-Message-6.36/lib/HTTP/Message.pmGETorPOSTreturns the source code of the given module path within the specified release/v1/source/{module}curl https://fastapi.metacpan.org/v1/source/HTTP::Message curl -XPOST https://fastapi.metacpan.org/v1/source/HTTP::MessageGETorPOSTreturns the full source of the latest, authorized version of the givenmodule
SEE ALSO
Net::API::CPAN, Net::API::CPAN::Activity, Net::API::CPAN::Author, Net::API::CPAN::Changes, Net::API::CPAN::Changes::Release, Net::API::CPAN::Contributor, Net::API::CPAN::Cover, Net::API::CPAN::Diff, Net::API::CPAN::Distribution, Net::API::CPAN::DownloadUrl, Net::API::CPAN::Exception, Net::API::CPAN::Favorite, Net::API::CPAN::File, Net::API::CPAN::Filter, Net::API::CPAN::Generic, Net::API::CPAN::List, Net::API::CPAN::Mirror, Net::API::CPAN::Mirrors, Net::API::CPAN::Module, Net::API::CPAN::Package, Net::API::CPAN::Permission, Net::API::CPAN::Rating, Net::API::CPAN::Release, Net::API::CPAN::Release::Recent, Net::API::CPAN::Release::Suggest, Net::API::CPAN::Scroll
CREDITS
Daniel Ruoso for the original Test::HTTP::MockServer
COPYRIGHT & LICENSE
Copyright(c) 2023 DEGUEST Pte. Ltd.
All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.