SRU::Request(3pm)
π SRU::Request π
okay bestie, welcome to SRU::Request from the User Contributed Perl Documentation corner of the universe β it's the factory zone where SRU request objects get built β¨
πΈ NAME πΈ
SRU::Request β literally just factories for creating SRU request objects. that's the whole job. iconic.
π SYNOPSIS π
use SRU::Request;
my $request = SRU::Request->newFromURI( $uri );
likeβ¦ that's it. two lines. you're already slaying π
π¦ DESCRIPTION π¦
so here's the vibe: SRU::Request lets you spin up the right SRU request object from a URI object. you hand it a URI, it hands you back one of SRU::Request::Explain, SRU::Request::Scan or SRU::Request::SearchRetrieve β whichever one matches the type of URI you passed in. no cap, it just knows.
and if you wanna know what's actually inside those objects? go read the docs for those classes, bestie, they have the lore π
π METHODS π
β¨ new( %query | $uri | $cgi | $env ) β¨
creates a brand new request object, and it's gonna be one of these three:
SRU::Request::ExplainSRU::Request::ScanSRU::Request::SearchRetrieve
and the way you can feed it params?? so many options, main character energy fr:
- as a hash of query parameters
- as a URL
- as a URI
- as a CGI object
- as a PSGI request
β οΈ but listen β if the request isn't formatted properly, the call returnsundef. and the error you hit should be chillin' in$SRU::Error. so check that, okay?? don't just sit there wondering why it's undef π
π newFromURI π
π newFromCGI π
these two are deprecated aliases for "new". like they still work but they're giving old money that ran out of money. use new instead, periodt.
π asXML() π
this one generates the <echoedExplainRequest>, <echoedSearchRetrieveRequest> and <echoedScanRequest> elements in the response. it's the β¨echoβ¨ of your request, living its best life in the XML.
π asURI( [ $base ] ) π
creates a URI of this request. π«Ά
the optional base URL β you can pass it as a string or as a URI β defaults to http://localhost/ if you don't give it one. lowkey a nice little default ngl.
β type() β
returns 'searchRetrieve', 'scan' or 'explain' depending on what type of object it is. it's giving "tell me who you really are" π₯
π§ COPYRIGHT AND LICENSE π§
this software is copyright (c) 2013 by Ed Summers.
it's free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, open source behavior π
and that's the whole page, bestie!! brought to you by perl v5.34.0, dated 2022-06-17, and yes this was SRU::Request(3pm) the entire time πΈβ¨ go build some requests, you've got this ππ
π¦ where this page comes from
- debian bookworm: libsru-perl 1.01-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libsru-perl 1.01-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libsru-perl 1.01-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libsru-perl 1.01-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libsru-perl 1.01-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms