NAME
Net::ISBNDB::Agent::REST - Agent sub-class that implements a REST protocol
SYNOPSIS
This module should not be directly used by user applications.
DESCRIPTION
This module implements the REST-based communication protocol for getting data from the isbndb.com service. At present, this is the only protocol the service supports.
METHODS
This class provides the following methods, most of which are restricted to this class and any sub-classes of it that may be written:
- parse_books($ROOT) (R)
- parse_categories($ROOT) (R)
- parse_publishers($ROOT) (R)
- parse_subjects($ROOT) (R)
-
Each of these parses the XML response for the corresponding API call. The
$ROOT
parameter is a XML::LibXML::Node object, obtained from parsing the XML returned by the service.Each of these returns a list-reference of objects, even when there is only one result value. All of these methods are restricted to this class and its decendants.
- request($OBJ, $ARGS, $SINGLE) (R)
-
Use the LWP::UserAgent object to make a request on the remote service.
$OBJ
indicates what type of data request is being made, and$ARGS
is a hash-reference of arguments to be passed in the request. The value$SINGLE
is a boolean that indicates whether a single value should be returned, or all values that result from parsing.This method is restricted to this class, and is the required overload of the request() method from the parent class (Net::ISBNDB::Agent).
- request_method($OBJ, $ARGS)
-
Returns the HTTP method (GET, POST, etc.) to use when making the request. The
$OBJ
and$ARGS
parameters may be used to determine the method (in the case of this protocol, they are ignored since GET is always the chosen HTTP method). - request_uri($OBJ, $ARGS)
-
Returns the complete HTTP URI to use in making the request.
$OBJ
is used to derive the type of data being fetched, and thus the base URI to use. The key/value pairs in the hash-reference provided by$ARGS
are used in the REST protocol to set the query parameters that govern the request.
CAVEATS
The data returned by this class is only as accurate as the data retrieved from isbndb.com.
The list of results from calling search() is currently limited to 10 items. This limit will be removed in an upcoming release, when iterators are implemented.
SEE ALSO
Net::ISBNDB::Agent, LWP::UserAgent
AUTHOR
Randy J. Ray <rjray@blackperl.com>
COPYRIGHT
This module and the code within are copyright (c) 2006 by Randy J. Ray and released under the terms of the Artistic License (http://www.opensource.org/licenses/artistic-license.php). This code may be redistributed under either the Artistic License or the GNU Lesser General Public License (LGPL) version 2.1 (http://www.opensource.org/licenses/lgpl-license.php).