NAME
Web::MREST::CLI - CLI components for Web::MEST-based applications
VERSION
Version 0.284
DESCRIPTION
Top-level module of the Web::MREST::CLI distribution. Exports some "generalized" functions that are used internally and might also be useful for writing CLI clients in general.
BASIC CLI CLIENT USAGE
Once you have run the CLI client executable (mrest-cli
) and assuming it is pointing correctly to a running MREST-compatible server, you can begin to explore the REST API by issuing the command:
get /
If the server is running at http://localhost:5000
, the same information can by obtained by pointing a web browser to that URI.
This will produce a list of top-level resources. To view documentation on a resource called foo
, issue the following command:
post docu pod foo
The documentation should include information on which HTTP methods can be used to access the resource.
To view documentation on the docu/pod
resource itself:
post docu pod docu/pod
EXPORTS
PACKAGE VARIABLES
FUNCTIONS
init_cli_client
Takes PARAMHASH containing possible parameters distro
, sitedir
, and debug_mode
. Initializes CLI client and returns a status object.
The distro
string should use hyphens instead of double-colons, i.e. Foo-Bar
instead of Foo::Bar
.
normalize_filespec
Given a filename (path) which might be relative or absolute, return an absolute version. If the path was relative, it will be anchored to the home directory of the user we are running as.
init_ua
Initialize the LWP::UserAgent singleton object.
cookie_jar
Return the cookie_jar associated with our user agent.
send_req
Send a request to the server, get the response, convert it from JSON, and return it to caller. Die on unexpected errors.