TheGameCrafter::Client - A simple client to TGC's web services.
version 0.0103
use TheGameCrafter::Client; my $game = tgc_get('game/528F18A2-F2C4-11E1-991D-40A48889CD00'); my $session = tgc_post('session', { username => 'me', password => '123qwe', api_key_id => 'abcdefghijklmnopqrztuz' }); $game = tgc_put('game/528F18A2-F2C4-11E1-991D-40A48889CD00', { session_id => $session->{id}, name => 'Lacuna Expanse' }); my $status = tgc_delete('game/528F18A2-F2C4-11E1-991D-40A48889CD00', { session_id => $session->{id} });
A light-weight wrapper for The Game Crafter's (http://thegamecrafter.com) RESTful API (https://www.thegamecrafter.com/developer/). This wrapper basically hides the request cycle from you so that you can get down to the business of using the API. It doesn't attempt to manage the data structures or objects the web service interfaces with.
The following subroutines are exported into your namespace wherever you use TheGameCrafter::Client.
use TheGameCrafter::Client
Performs a GET request, which is used for reading data from the service.
GET
The path to the REST interface you wish to call. You can abbreviate and leave off the /api/ part if you wish.
/api/
A hash reference of parameters you wish to pass to the web service.
Performs a DELETE request, deleting data from the service.
DELETE
Performs a PUT request, which is used for updating data in the service.
PUT
Performs a POST request, which is used for creating data in the service.
POST
LWP::UserAgent Ouch HTTP::Request::Common JSON URI
http://github.com/rizen/TheGameCrafter-Client
http://github.com/rizen/TheGameCrafter-Client/issues
JT Smith <jt_at_plainblack_dot_com>
This module is Copyright 2012 Plain Black Corporation. It is distributed under the same terms as Perl itself.
To install TheGameCrafter::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm TheGameCrafter::Client
CPAN shell
perl -MCPAN -e shell install TheGameCrafter::Client
For more information on module installation, please visit the detailed CPAN module installation guide.