.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Arch::LiteWeb 3pm" .TH Arch::LiteWeb 3pm "2022-06-08" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Arch::LiteWeb \- simple way to access web pages .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 \& 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}; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class provides a basic and easy to use support for the client-side \s-1HTTP.\s0 It is supplied in order to avoid dependency on \s-1LWP.\s0 If such dependency is not a problem, consider to use \s-1LWP\s0 instead that provides much better support for \s-1HTTP\s0 and other protocols. .SH "METHODS" .IX Header "METHODS" The following class methods are available: .PP \&\fBget\fR, \&\fBpost\fR, \&\fBrequest_url\fR, \&\fBerror\fR, \&\fBerror_with_url\fR, \&\fBnetwork_error\fR, \&\fBresponse_code\fR, \&\fBresponse_codestr\fR, \&\fBresponse_error\fR, \&\fBresponse_headers\fR, \&\fBresponse_content\fR. .IP "\fBget\fR \fIurl\fR [\fIparams\fR ...]" 4 .IX Item "get url [params ...]" Execute \s-1HTTP\s0 get of the given \fIurl\fR and return the html string or undef on network/response error. Use other methods to get the details about the error and the response. .Sp \&\fIparams\fR is key-value hash, the following keys are supported: .Sp .Vb 10 \& 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 "\e015\e012" \& timeout \- default is 20 seconds \& user_agent \- default is "Arch::LiteWeb/0.1" \& nocache \- add a no\-cache header \& noredirect \- don\*(Aqt 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) .Ve .IP "\fBpost\fR \fIurl\fR \fIinput\fR [\fIparams\fR]" 4 .IX Item "post url input [params]" Not implemented yet. .IP "\fBrequest_url\fR" 4 .IX Item "request_url" Actual url of the last issued request or \fIundef\fR. If partial redirect responses are enabled, then the result is the last (non-redirect) url. .IP "\fBerror\fR" 4 .IX Item "error" If the last request resulted in error (i.e. \fBget\fR/\fBpost\fR returned \fIundef\fR), then this method returns the error message, otherwise it returns \fIundef\fR. This is just a shortcut for \fBnetwork_error\fR || \fBresponse_error\fR. .IP "\fBerror_with_url\fR" 4 .IX Item "error_with_url" Like error, but with "\enwhile fetching \fIrequest_url\fR\en" text appended if non undef. .IP "\fBnetwork_error\fR" 4 .IX Item "network_error" The network error message for the last request or \fIundef\fR. .IP "\fBresponse_error\fR" 4 .IX Item "response_error" The response error message for the last request or \fIundef\fR. .IP "\fBresponse_code\fR" 4 .IX Item "response_code" The last response code (integer) or \fIundef\fR. .IP "\fBresponse_codestr\fR" 4 .IX Item "response_codestr" The last response code (string) or \fIundef\fR. .IP "\fBresponse_headers\fR" 4 .IX Item "response_headers" The last response headers (hashref of \s-1HTTP\s0 headers) or \fIundef\fR. .IP "\fBresponse_content\fR" 4 .IX Item "response_content" The last response content or \fIundef\fR. This is the same thing that the last \fBget\fR/\fBpost\fR returns. .SH "BUGS" .IX Header "BUGS" Not intended for use in mission-critical applications. .SH "AUTHORS" .IX Header "AUTHORS" Mikhael Goikhman (migo@homemail.com\*(--Perl\-GPL/arch\-perl\*(--devel). .SH "SEE ALSO" .IX Header "SEE ALSO" For more information, see \s-1LWP\s0, LWP::Simple.