Arch::LiteWeb
simple way to access web pages
- Provided by: libarch-perl (Version: 0.5.2-2)
- Report a bug
simple way to access web pages
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};
This class provides a basic and easy to use support for the client-side HTTP. It is supplied in order to avoid dependency on LWP. If such dependency is not a problem, consider to use LWP instead that provides much better support for HTTP and other protocols.
The following class methods are available:
get, post, request_url, error, error_with_url, network_error, response_code, response_codestr, response_error, response_headers, response_content.
params is key-value hash, the following keys are supported:
url_host - only used if url is none
url_port - only used if url is none (80)
url_path - only used if url is none
endl - default is "\015\012"
timeout - default is 20 seconds
user_agent - default is "Arch::LiteWeb/0.1"
nocache - add a no-cache header
noredirect - don't follow redirect responses
max_redirect_depth - default is 5
use_proxy - default is false
proxy_url - proxy url ($http_proxy supported too)
proxy_host - only used if proxy_url is none
proxy_port - only used if proxy_url is none (80)
Not intended for use in mission-critical applications.
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).
For more information, see LWP, LWP::Simple.