Arch::LiteWeb(3pm)
β¨ Arch::LiteWeb β¨
okay bestie, so this is a <pink>User Contributed Perl Documentation</pink> page for Arch::LiteWeb β that's the 3pm manual section, iykyk π
. It's the whole "I just wanna grab a web page" situation, no drama, no giant dependency tree. Let's get into it π«Ά
πΈ NAME πΈ
Arch::LiteWeb β the simple way to access web pages. that's it. that's the whole vibe. β¨
π¦ SYNOPSIS π¦
my $web = Arch::LiteWeb->new;
my $content = $web->get("http://some.domain:81/some/path");
die $web->error . " while processing " . $web->request_url
unless $content;
my $content_type = $web->response_headers->{content_type};
see how chill that is?? you make an object, you get a url, you check the error, you read the headers. main character energy fr fr π
π DESCRIPTION π
So this class gives you basic and easy-to-use client-side HTTP support. It exists literally so you don't have to depend on LWP. that's the whole point π
But listen β if having that dependency isn't a problem for you, the docs say to consider using LWP instead, because LWP provides much better support for HTTP and other protocols. no cap. this thing is the lite version on purpose π
π METHODS π
here's the full roster of class methods available, bestie β all of them, no skipping:
get, post, request_url, error, error_with_url, network_error, response_code, response_codestr, response_error, response_headers, response_content.
π
get url [params ...]
Executes an HTTP get on the given url and returns the html string β or undef if there's a network/response error. If you want the deets about what went wrong or what came back, use the other methods, okurrr? π§
params is a key-value hash. These are the supported keys, every single one:
url_hostβ only used if url is noneurl_portβ only used if url is none (default:80)url_pathβ only used if url is noneendlβ default is"\015\012"timeoutβ default is20secondsuser_agentβ default is"Arch::LiteWeb/0.1"nocacheβ adds a no-cache headernoredirectβ don't follow redirect responsesmax_redirect_depthβ default is5use_proxyβ default is falseproxy_urlβ proxy url ($http_proxysupported too)proxy_hostβ only used ifproxy_urlis noneproxy_portβ only used ifproxy_urlis none (default:80)
π post url input [params]
Not implemented yet. π yeah bestie, it's giving "coming soon" but there's no eta. don't @ me.
β request_url
The actual url of the last request that was issued β or undef. And here's the lil plot twist: if partial redirect responses are enabled, then the result is the last (non-redirect) url. slay, it tells you where you actually landed π¦
π error
If the last request ended in an error (meaning get/post returned undef), this method returns the error message. Otherwise it returns undef. It's literally just a shortcut for:
network_error || response_error
iconic and efficient. periodt. β¨
π error_with_url
Like error, but with this text appended if it's non-undef:
"\nwhile fetching request_url\n"
so now you get the url context too, bestie. very demure, very mindful π
πΈ network_error
The network error message for the last request, or undef.
πΊ response_error
The response error message for the last request, or undef.
π response_code
The last response code as an integer, or undef.
π§ response_codestr
The last response code as a string, or undef.
π₯ response_headers
The last response headers β a hashref of HTTP headers β or undef.
π response_content
The last response content, or undef. This is the same thing that the last get/post returns, so it's giving "same energy, different door" π«Ά
π BUGS π
Not intended for use in mission-critical applications.
like. bestie. read that again. this is NOT the thing you put in prod at 3am. the docs said what they said ππ¨
π AUTHORS π
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel). π
β SEE ALSO β
For more information, see LWP, LWP::Simple. those are your other girls, go say hi π¦
okay that's the whole page, you ate that reading session π
π this was perl v5.20.2, dated 2005-03-25 β vintage, but she still serves. mwah, bye bestie! πβ¨
π¦ where this page comes from
- ubuntu jammy: libarch-perl 0.5.2-2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms