NAME

TheGameCrafter::Client - A simple client to TGC's web services.

VERSION

version 0.0103

SYNOPSIS

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} });

DESCRIPTION

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.

SUBROUTINES

The following subroutines are exported into your namespace wherever you use TheGameCrafter::Client.

tgc_get(path, params)

Performs a GET request, which is used for reading data from the service.

path

The path to the REST interface you wish to call. You can abbreviate and leave off the /api/ part if you wish.

params

A hash reference of parameters you wish to pass to the web service.

tgc_delete(path, params)

Performs a DELETE request, deleting data from the service.

path

The path to the REST interface you wish to call. You can abbreviate and leave off the /api/ part if you wish.

params

A hash reference of parameters you wish to pass to the web service.

tgc_put(path, params)

Performs a PUT request, which is used for updating data in the service.

path

The path to the REST interface you wish to call. You can abbreviate and leave off the /api/ part if you wish.

params

A hash reference of parameters you wish to pass to the web service.

tgc_post(path, params)

Performs a POST request, which is used for creating data in the service.

path

The path to the REST interface you wish to call. You can abbreviate and leave off the /api/ part if you wish.

params

A hash reference of parameters you wish to pass to the web service.

PREREQS

LWP::UserAgent Ouch HTTP::Request::Common JSON URI

SUPPORT

Repository

http://github.com/rizen/TheGameCrafter-Client

Bug Reports

http://github.com/rizen/TheGameCrafter-Client/issues

AUTHOR

JT Smith <jt_at_plainblack_dot_com>

LEGAL

This module is Copyright 2012 Plain Black Corporation. It is distributed under the same terms as Perl itself.