Wing::Client - A simple client to Wing's web services.
version 1.1000
use Wing::Client; my $wing = Wing::Client->new(uri => 'https://www.thegamecrafter.com'); my $game = $wing->get('game/528F18A2-F2C4-11E1-991D-40A48889CD00'); my $session = $wing->post('session', { username => 'me', password => '123qwe', api_key_id => 'abcdefghijklmnopqrztuz' }); $game = $wing->put('game/528F18A2-F2C4-11E1-991D-40A48889CD00', { session_id => $session->{id}, name => 'Lacuna Expanse' }); my $status = $wing->delete('game/528F18A2-F2C4-11E1-991D-40A48889CD00', { session_id => $session->{id} });
A light-weight wrapper for Wing's (https://github.com/plainblack/Wing) RESTful API (an example of which can be found at: 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 methods are available.
Constructor.
A hash of parameters.
The base URI of the service you're interacting with. Example: https://www.thegamecrafter.com.
https://www.thegamecrafter.com
A Wing session_id. If set, this is automatically added to all requests because I'm lazy. If you don't want a session_id for a while, set the no_session_id flag on the object.
no_session_id
If set to true, prevents adding the session_id to the request.
A LWP::UserAgent object used to keep a persistent cookie_jar across requests.
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
Defaults to 0. If 1 then when you pass a param that is an array reference, the value of that array reference will be assumed to be a file name and will attempt to be uploaded per the inner workings of HTTP::Request::Common.
Performs a POST request, which is used for creating data in the service.
POST
HTTP::Thin Ouch HTTP::Request::Common HTTP::CookieJar JSON URI Moo
http://github.com/rizen/Wing-Client
http://github.com/rizen/Wing-Client/issues
JT Smith <jt_at_plainblack_dot_com>
This module is Copyright 2013 Plain Black Corporation. It is distributed under the same terms as Perl itself.
To install Wing::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wing::Client
CPAN shell
perl -MCPAN -e shell install Wing::Client
For more information on module installation, please visit the detailed CPAN module installation guide.