NAME

HTTP::OAI::Response - An OAI response

METHODS

$r = new HTTP::OAI::Response([-responseDate=>$rd][, -requestURL=>$ru])

This constructor method returns a new HTTP::OAI::Response object. Optionally set the responseDate and requestURL.

Use $r->is_error to test whether the request was successful. In addition to the HTTP response codes, the following codes may be returned:

600 - Error parsing XML or invalid OAI response

Use $r->message to obtain a human-readable error message.

$headers = $r->headers

Returns the embedded HTTP::OAI::Headers object.

$r->code
$r->message

Returns the HTTP code (600 if there was an error with the OAI response) and a human-readable message.

$errs = $r->errors([$err])

Returns and optionally adds to the OAI error list. Returns a reference to an array.

$rd = $r->responseDate([$rd])
$ru = $r->requestURL([$ru])
$verb = $r->verb([$verb])

These methods are wrappers around the Header fields of the same name.

$r->version

Return the version of the OAI protocol used by the remote site (protocolVersion is automatically changed by the underlying API).

NOTE - requestURI/request

Version 2.0 of OAI uses a "request" element to contain the client's request, rather than a URI. The OAI-PERL library automatically converts from a URI into the appropriate request structure, and back again when harvesting.

The exception to this rule is for badVerb errors, where the arguments will not be available for conversion into a URI.