NAME

Usergrid::Request - Role that provides HTTP invocation and utility methods

DESCRIPTION

This is a Role that is applied to Usergrid::Client and Usergrid::Collection which provides methods that relate to HTTP invocation as well as some utility functions.

ATTRIBUTES

organization (String)

Organization name

application (String)

Application name

api_url (String)

URL of the Usergrid instance

trace (Boolean)

Enable/disable request and response tracing for debugging and troubleshooting (Optional)

METHODS

HTTP Invocation Methods

DELETE ( $resource )

Invokes HTTP DELETE on the specified resource.

GET ( $resource )

Invokes HTTP GET on the specified resource.

POST ( $resource, \%request )

Invokes HTTP POST on the specified resource and passes in the payload for the request.

PUT ( $resource, \%request )

Invokes HTTP PUT on the specified resource and passes in the payload for the request.

Utility Methods

trace_message ( $message )

Utility method to log a message to console if tracing is enabled.

prettify ( $message, \%object )

Returns a prettified string representation hash reference.

json_encode ( \%hashref )

Returns a JSON object from a hash reference.

json_decode ( $json_object )

Returns a hash reference from a JSON object.

SEE ALSO

Usergrid::Client, Usergrid::Collection, Usergrid::Entity

LICENSE

This software is distributed under the Apache 2 license.

AUTHOR

Anuradha Weeraman <anuradha@cpan.org>