HTTP::...rAgent(3pm)

πŸ“¦
version 4.13 Β· 5 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay so bestie, gather round: this is the manual page for HTTP::...rAgent(3pm), and the module it's all about is HTTP::OAI::UserAgent β€” literally an extension of the LWP::UserAgent made for OAI HTTP requests. that's the whole vibe. πŸ’…


✨ DESCRIPTION ✨

so here's the tea πŸ«–: this module gives you a simplified mechanism for making requests to an OAI repository, and it does it by riding on the existing LWP::UserAgent module. that's it, that's the pitch. lowkey elegant, highkey useful. πŸ¦‹


🌸 SYNOPSIS 🌸

require HTTP::OAI::UserAgent;

my $ua = new HTTP::OAI::UserAgent;

my $response = $ua->request(
        baseURL=>'http://arXiv.org/oai1',
        verb=>'ListRecords',
        from=>'2001-08-01',
        until=>'2001-08-31'
);

print $response->content;

like. look at that. no cap, that's the entire flow. πŸ‘‘


πŸŽ€ METHODS πŸŽ€

  • $ua = new HTTP::OAI::UserAgent(proxy=>'www-cache',...) β€” this constructor method hands you back a brand new instance of a HTTP::OAI::UserAgent module. and the way that every single argument gets passed straight through to the LWP::UserAgent constructor?? obsessed. 🫢
  • $r = $ua->request($req) β€” requests the HTTP response defined by $req, which is a HTTP::Request object. simple. clean. iconic.
  • $r = $ua->request(baseURL=>$baseref, verb=>$verb, %opts) β€” makes an HTTP request to the given OAI server (baseURL) with OAI arguments, and returns an HTTP::Response object. bestie, it just works. ✨

OAI-PMH related options, aka the lil extras you can sprinkle in:

        from => $from
        until => $until
        resumptionToken => $token
        metadataPrefix => $mdp
        set => $set
  • $time_d = $ua->delay( $time_d ) β€” return and optionally set a time (in seconds) to wait between requests. πŸ•°οΈ and heads up: $time_d may be a CODEREF. yes fr fr, a coderef. she contains multitudes. πŸ’€

and that's the page, bestie πŸ’œ this lil gem ships with perl v5.36.0, dated 2023-09-28, straight outta the User Contributed Perl Documentation. go forth and query your OAI repos, main character. 🌈⭐

πŸ“¦ where this page comes from