URI::F...sponse(3pm)
π URI::Fetch::Response β the vibe is feed response π
okay so this is a page from the User Contributed Perl Documentation set, and honestly? it's giving "tiny module, huge main character energy." it's URI::Fetch::Response(3pm), bestie. let's get into it π«Ά
β¨ NAME β¨
URI::Fetch::Response β literally just the Feed response for URI::Fetch. that's the whole name, no notes π
πΈ SYNOPSIS πΈ
use URI::Fetch;
my $res = URI::Fetch->fetch('http://example.com/atom.xml')
or die URI::Fetch->errstr;
print $res->content;
see how cute and small that is? you fetch, you check, you print. slay. π₯
π¦ DESCRIPTION π¦
URI::Fetch::Response encapsulates the response you get back from fetching a feed using URI::Fetch. it's the little wrapped-up present of "here's what the server said" π
π USAGE π
π $res->content
the contents of the feed. that's it, that's the payload, the whole reason we're here π
π $res->uri
the URI of the feed. important detail, no cap: if the feed was moved, this reflects the new URI; otherwise it'll match the URI you passed to fetch. so like, it keeps up with the drama π«
π $res->etag
the ETag that was returned in the response β if any. sometimes it's there, sometimes it ghosted you π
π $res->last_modified
the Last-Modified date that came back in the response, measured in seconds since the epoch β again, if any. same deal, it might just not show up π
π $res->status
the status of the response, and it'll match one of these enumerations, periodt:
URI::Fetch::URI_OK()URI::Fetch::URI_MOVED_PERMANENTLY()URI::Fetch::URI_GONE()URI::Fetch::URI_NOT_MODIFIED()
π $res->http_status
the HTTP status code from the response. the raw number, bestie π’
π $res->http_response
the HTTP::Response object that got returned from the fetch. the whole thing, untouched β¨
π $res->is_success, $res->is_redirect, $res->is_error
these three are wrappers around the $res->response methods of the same name, because convenience is a love language π«Ά
note, and this one actually matters: there is one difference from the behaviour ofHTTP::Response. if you're using a cache and you get a304response, but the data is retrieved from the cache, thenis_successwill return true β becauseres->contentis usable. so don't panic when it says success, it's correct π
π $res->content_type
the Content-Type header from the response. tell me what you are, king π
π AUTHOR & COPYRIGHT π
for author, copyright, and license info, please see the URI::Fetch manpage. all the credits live over there, go give them their flowers π
and that's the whole page, bestie!! this was perl v5.32.1, dated 2021-09-16, and it ate fr fr. mwah π β¨
π¦ where this page comes from
- debian bookworm: liburi-fetch-perl 0.15-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: liburi-fetch-perl 0.15-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: liburi-fetch-perl 0.15-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: liburi-fetch-perl 0.15-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: liburi-fetch-perl 0.15-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liburi-fetch-perl 0.15-1 Β· 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