NAME
Net::Dynect::REST - A REST implementation to communicate with Dynect
SYNOPSIS
use Net::Dynect::REST
my $dynect = Net::Dynect::REST->new();
$dynect->login(user_name => $user, customer_name => $customer, password => $password;
METHODS
Creating
- Net::Dynect::REST->new()
-
This constructor will return an object, and can optionally attempt to establish a session if sufficient authentication details are passed as parameters. It takes the optional arguments of:
debug
A numeric debug level, where 0 is silent, 1 is standard output, and higher gives more details.
server
protocol
base_path
port
user_name
customer_name
password
Methods
- $dynect->login()
-
This will attempt to create a valid Session object by forming and sending a login request, and parsing the response. Parameters are:
user_name
customer_name
password
- $dynect->logout()
-
If we have a valid session, then this will try and perform a logout against Dynect, and remove our sesssion object.
- $dynect->execute()
-
This is the main heavy lifting; where Net::Dynect::REST::Request objects get sent to the server, and a Net::Dynect::REST::Response is returned, if all is OK. It takes one argument - the Net::Dynect::REST::Request object.
- $dynect->session()
-
This is a Net::Dynect::REST::Session object, which should eb the current valid session for this Net::Dynect::REST object to use. It updates the web client to include the Auth-Token header for subsequent requests
Attributes
- $dynect->server()
-
This is the server host name that we will send our requests to. Default is api2.dynect.net.
- $dynect->protocol()
-
This is the protocol we will use, either http or https. Default is https.
- $dynect->base_path()
-
This is the path that is used to find the services we will be accessing. Default is /REST/.
- $dynect->port()
-
The TCP port that we will use. The default is to use whatever is apropriate for the protocol.
- $dynect->base_uri()
-
A convenience method to put together the protocl, server, port and base_path attributes into a URI.
SEE ALSO
Net::Dynect::REST::Request, Net::Dynect::REST::Response, Net::Dynect::REST::info.
AUTHOR
James bromberger, james@rcpt.to
COPYRIGHT AND LICENSE
Copyright (C) 2010 by James Bromberger
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.