SRU::Request - Factories for creating SRU request objects.
use SRU::Request; my $request = SRU::Request->newFromURI( $uri );
SRU::Request allows you to create the appropriate SRU request object from a URI object. This allows you to pass in a URI and get back one of SRU::Request::Explain, SRU::Request::Scan or SRU::Request::SearchRetrieve depending on the type of URI that is passed in. See the docs for those classes for more information about what they contain.
newFromURI() is a factory method which you pass a complete SRU url. newFromURI() will return an appropriate object for the type of request being conducted:
SRU::Request::Explain
SRU::Request::Scan
SRU::Request::SearchRetrieve
If the request is not formatted properly the call will return undef. The error encountered should be available in $SRU::Error.
A factory method for creating a request object from a CGI object.
my $cgi = CGI->new(); my $request = SRU::Request->newFromCGI( $cgi );
Used to generate <echoedExplainRequest>, <echoedSearchRetrieveRequest> and <echoedScanRequest> elements in the response.
To install SRU, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SRU
CPAN shell
perl -MCPAN -e shell install SRU
For more information on module installation, please visit the detailed CPAN module installation guide.