.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 "HTTP::Tinyish 3pm" .TH HTTP::Tinyish 3pm 2024-03-18 "perl v5.38.2" "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 HTTP::Tinyish \- HTTP::Tiny compatible HTTP client wrappers .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& my $http = HTTP::Tinyish\->new(agent => "Mozilla/4.0"); \& \& my $res = $http\->get("http://www.cpan.org/"); \& warn $res\->{status}; \& \& $http\->post("http://example.com/post", { \& headers => { "Content\-Type" => "application/x\-www\-form\-urlencoded" }, \& content => "foo=bar&baz=quux", \& }); \& \& $http\->mirror("http://www.cpan.org/modules/02packages.details.txt.gz", "./02packages.details.txt.gz"); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" HTTP::Tinyish is a wrapper module for HTTP client modules LWP, HTTP::Tiny and HTTP client software \f(CW\*(C`curl\*(C'\fR and \f(CW\*(C`wget\*(C'\fR. .PP It provides an API compatible to HTTP::Tiny, and the implementation has been extracted out of App::cpanminus. This module can be useful in a restrictive environment where you need to be able to download CPAN modules without an HTTPS support in built-in HTTP library. .SH "BACKEND SELECTION" .IX Header "BACKEND SELECTION" Backends are searched in the order of: LWP, HTTP::Tiny, \f(CW\*(C`curl\*(C'\fR and \f(CW\*(C`wget\*(C'\fR. HTTP::Tinyish will auto-detect if the backend also supports HTTPS, and use the appropriate backend based on the given URL to the request methods. .PP For example, if you only have HTTP::Tiny but without SSL related modules, it is possible that: .PP .Vb 1 \& my $http = HTTP::Tinyish\->new; \& \& $http\->get("http://example.com"); # uses HTTP::Tiny \& $http\->get("https://example.com"); # uses curl .Ve .SH COMPATIBILITIES .IX Header "COMPATIBILITIES" All request related methods such as \f(CW\*(C`get\*(C'\fR, \f(CW\*(C`post\*(C'\fR, \f(CW\*(C`put\*(C'\fR, \&\f(CW\*(C`delete\*(C'\fR, \f(CW\*(C`request\*(C'\fR, \f(CW\*(C`patch\*(C'\fR and \f(CW\*(C`mirror\*(C'\fR are supported. .SS LWP .IX Subsection "LWP" .IP \(bu 4 LWP backend requires LWP 5.802 or over to be functional, and LWP::Protocol::https to send HTTPS requests. .IP \(bu 4 \&\f(CW\*(C`mirror\*(C'\fR method doesn't consider third options hash into account (i.e. you can't override the HTTP headers). .IP \(bu 4 proxy is automatically detected from environment variables. .IP \(bu 4 \&\f(CW\*(C`timeout\*(C'\fR, \f(CW\*(C`max_redirect\*(C'\fR, \f(CW\*(C`agent\*(C'\fR, \f(CW\*(C`default_headers\*(C'\fR and \f(CW\*(C`verify_SSL\*(C'\fR are translated. .SS HTTP::Tiny .IX Subsection "HTTP::Tiny" Because the actual HTTP::Tiny backend is used, all APIs are supported. .SS Curl .IX Subsection "Curl" .IP \(bu 4 This module has been tested with curl 7.22 and later. .IP \(bu 4 HTTPS support is automatically detected by running \f(CW\*(C`curl \-\-version\*(C'\fR and see its protocol output. .IP \(bu 4 \&\f(CW\*(C`timeout\*(C'\fR, \f(CW\*(C`max_redirect\*(C'\fR, \f(CW\*(C`agent\*(C'\fR, \f(CW\*(C`default_headers\*(C'\fR and \f(CW\*(C`verify_SSL\*(C'\fR are supported. .SS Wget .IX Subsection "Wget" .IP \(bu 4 This module requires Wget 1.12 and later. .IP \(bu 4 Wget prior to 1.15 doesn't support sending custom HTTP methods, so if you use \f(CW\*(C`$http\->put\*(C'\fR for example, you'll get an internal error response (599). .IP \(bu 4 HTTPS support is automatically detected. .IP \(bu 4 \&\f(CWmirror()\fR method doesn't send \f(CW\*(C`If\-Modified\-Since\*(C'\fR header to the server, which will result in full-download every time because \f(CW\*(C`wget\*(C'\fR doesn't support \f(CW\*(C`\-\-timestamping\*(C'\fR combined with \f(CW\*(C`\-O\*(C'\fR option. .IP \(bu 4 \&\f(CW\*(C`timeout\*(C'\fR, \f(CW\*(C`max_redirect\*(C'\fR, \f(CW\*(C`agent\*(C'\fR, \f(CW\*(C`default_headers\*(C'\fR and \f(CW\*(C`verify_SSL\*(C'\fR are supported. .SH "SIMILAR MODULES" .IX Header "SIMILAR MODULES" .IP \(bu 4 File::Fetch \- is core since 5.10. Has support for non-HTTP protocols such as ftp and git. Does not support HTTPS or basic authentication as of this writing. .IP \(bu 4 Plient \- provides more complete runtime API, but seems only compatible on Unix environments. Does not support \fBmirror()\fR method. .SH AUTHOR .IX Header "AUTHOR" Tatsuhiko Miyagawa .SH COPYRIGHT .IX Header "COPYRIGHT" Tatsuhiko Miyagawa, 2015\- .SH LICENSE .IX Header "LICENSE" This module is licensed under the same terms as Perl itself.