The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

    client.pl   -- Example RESTful client.

SYNOPSIS

    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

DESCRIPTION

    This client provides a mechanism whereby RESTful services can be
    invoked.

PARAMETERS

    $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.

AUTHOR

    John "Frotz" Fa'atuai, frotz@acm.org

METHODS

main()

USAGE:

    &main( $method, $url, $arg1, $arg2 );
    exit( 0 );

DESCRIPTION:

    This is the main command line processing method.  All work is done
    here.

read()

USAGE:

    $contents = &read( $file );

DESCRIPTION:

    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()

USAGE:

    &usage();

DESCRIPTION:

    This method emits the command line usage and exits.