Astro::Catalog::Transport::REST - A base class for REST query modules
use base qw/ Astro::Catalog::Transport::REST /;
This class forms a base class for all the REST based query classes provided in the Astro::Catalog distribution (eg Astro::Catalog::Query::GSC).
Astro::Catalog
Astro::Catalog::Query::GSC
$Id: REST.pm,v 1.7 2004/03/03 00:50:15 cavanagh Exp $
Create a new instance from a hash of options
$q = new Astro::Catalog::Transport::REST( Coords => new Astro::Coords(), Radius => $radius, Bright => $magbright, Faint => $magfaint, Sort => $sort_type, Number => $number_out );
returns a reference to an query object. Must only called from sub-classed constructors.
RA and Dec are also allowed but are deprecated (since with only RA/Dec the coordinates must always be supplied as J2000 space-separated sexagesimal format).
The LWP user agent mediating the web transaction.
$ua = $q->useragent();
Created automatically the first time it is requested.
Returns an Astro::Catalog object resulting from the specific query.
$catalog = $q->querydb();
Return (or set) the current proxy for the catalog request.
$usno->proxy( 'http://wwwcache.ex.ac.uk:8080/' ); $proxy_url = $usno->proxy();
Return (or set) the current timeout in seconds for the request.
$usno->timeout( 30 ); $proxy_timeout = $usno->timeout();
Default is 30 seconds.
The URL formed to build up a query. Made up of a root host name (that can be set using the url method) and a fixed suffix that specifies the path to the service (CGI or otherwise). This query URL does not include the arguments to the CGI script (but will include the question mark if appropriate).
url
$query_url = $q->query(); $q->query_url( 'http://www.blah.org/cgi-bin/xxx.pl?');
Care must be taken when setting this value.
The argument is not validated. There may also need to be a new method that returns the full URL including arguments.
If no value has been supplied, a default will be returned.
Return the current remote host for the query (the full URL can be returned using the query_url method).
query_url
$host = $q->url();
Can also be used to set the root host for the URL (ie the machine name but no path component)
$q->url( "archive.eso.org" );
if not defined the default URL is used (specified in the sub class). This method should really be called remote_host.
remote_host
Returns the default host name specified by the particular subclass if a value has not been defined.
Returns the user agent tag sent by the module to the server.
$agent_tag = $q->agent();
The user agent tag can not be set by this method.
# T I M E A T T H E B A R --------------------------------------------
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head2'
To install Astro::Catalog, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Astro::Catalog
CPAN shell
perl -MCPAN -e shell install Astro::Catalog
For more information on module installation, please visit the detailed CPAN module installation guide.