client.pl -- Example RESTful client.
perl client.pl $method $url $arg1 $arg2 perl client.pl GET $url $accept_type > results perl client.pl PUT $url $filename $accept_type perl client.pl POST $url $filename $accept_type perl client.pl DELETE $url $accept_type
This client provides a mechanism whereby RESTful services can be invoked.
$method -- GET, PUT, POST, DELETE $url -- The RESTful URL that should be invoked. $arg1 -- Either $accept_type for GET or $filename for PUT and POST. $arg2 -- $accept_type for PUT and POST. $accept_type-- The requested response MIME-type. This must be supported by the remote RESTful service. For example: "text/javascript" -- JSON "text/html" -- HTML "text/plain" -- Text "application/xml" -- XML $filename -- The name of the file to be uploaded via PUT and POST. If "-", then STDIN will be consumed instead.
John "Frotz" Fa'atuai, frotz@acm.org
USAGE:
&main( $method, $url, $arg1, $arg2 ); exit( 0 );
DESCRIPTION:
This is the main command line processing method. All work is done here.
$contents = &read( $file );
This method reads the contents of the specified $file or dies. If $file eq "-", then the returned $contents will be everything read from <STDIN>.
&usage();
This method emits the command line usage and exits.
To install REST::Resource, copy and paste the appropriate command in to your terminal.
cpanm
cpanm REST::Resource
CPAN shell
perl -MCPAN -e shell install REST::Resource
For more information on module installation, please visit the detailed CPAN module installation guide.