.\" 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 "HTTP::Tinyish 3pm" .TH HTTP::Tinyish 3pm "2022-06-26" "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" 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 \s-1HTTP\s0 client modules \&\s-1LWP\s0, HTTP::Tiny and \s-1HTTP\s0 client software \f(CW\*(C`curl\*(C'\fR and \f(CW\*(C`wget\*(C'\fR. .PP It provides an \s-1API\s0 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 \&\s-1CPAN\s0 modules without an \s-1HTTPS\s0 support in built-in \s-1HTTP\s0 library. .SH "BACKEND SELECTION" .IX Header "BACKEND SELECTION" Backends are searched in the order of: \s-1LWP\s0, 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 \s-1HTTPS,\s0 and use the appropriate backend based on the given \&\s-1URL\s0 to the request methods. .PP For example, if you only have HTTP::Tiny but without \s-1SSL\s0 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 "\s-1LWP\s0" .IX Subsection "LWP" .IP "\(bu" 4 \&\s-1LWP\s0 backend requires \s-1LWP\s0 5.802 or over to be functional, and LWP::Protocol::https to send \s-1HTTPS\s0 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 \s-1HTTP\s0 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 \&\s-1HTTPS\s0 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 \s-1HTTP\s0 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 \&\s-1HTTPS\s0 support is automatically detected. .IP "\(bu" 4 \&\f(CW\*(C`mirror()\*(C'\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 \s-1HTTPS\s0 or basic authentication as of this writing. .IP "\(bu" 4 Plient \- provides more complete runtime \s-1API,\s0 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.