---
name: "HTTP::OAI::ListSets"
section: "3pm"
platform: "linux"
package: "libhttp-oai-perl"
version: "4.13-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/HTTP::OAI::ListSets"
---

# HTTP::OAI::ListSets(3pm)

Provide access to an OAI ListSets response

## NAME

HTTP::OAI::ListSets - Provide access to an OAI ListSets response

## SYNOPSIS

```
        my $r = $h->ListSets();
        while( my $rec = $r->next ) {
                print $rec->setSpec, "\n";
        }
        die $r->message if $r->is_error;
```

## METHODS

- $ls = new HTTP::OAI::ListSets

  This constructor method returns a new OAI::ListSets object.

- $set = $ls-\>next

  Returns either an HTTP::OAI::Set object, or undef, if no more records are available. Use `$set`-\>is\_error to test whether there was an error getting the next record.

  If -resume was set to false in the Harvest Agent, next may return a string (the resumptionToken).

- @setl = $ls-\>set(\[$set\])

  Returns the set list and optionally adds a new set or resumptionToken, `$set`. Returns an array ref of HTTP::OAI::Sets, with an optional resumptionToken string.

- $token = $ls-\>resumptionToken(\[$token\])

  Returns and optionally sets the HTTP::OAI::ResumptionToken.

- $dom = $ls-\>toDOM

  Returns a XML::DOM object representing the ListSets response.
