1HTTP::Tinyish(3)      User Contributed Perl Documentation     HTTP::Tinyish(3)
2
3
4

NAME

6       HTTP::Tinyish - HTTP::Tiny compatible HTTP client wrappers
7

SYNOPSIS

9         my $http = HTTP::Tinyish->new(agent => "Mozilla/4.0");
10
11         my $res = $http->get("http://www.cpan.org/");
12         warn $res->{status};
13
14         $http->post("http://example.com/post", {
15             headers => { "Content-Type" => "application/x-www-form-urlencoded" },
16             content => "foo=bar&baz=quux",
17         });
18
19         $http->mirror("http://www.cpan.org/modules/02packages.details.txt.gz", "./02packages.details.txt.gz");
20

DESCRIPTION

22       HTTP::Tinyish is a wrapper module for HTTP client modules LWP,
23       HTTP::Tiny and HTTP client software "curl" and "wget".
24
25       It provides an API compatible to HTTP::Tiny, and the implementation has
26       been extracted out of App::cpanminus. This module can be useful in a
27       restrictive environment where you need to be able to download CPAN
28       modules without an HTTPS support in built-in HTTP library.
29

BACKEND SELECTION

31       Backends are searched in the order of: LWP, HTTP::Tiny, "curl" and
32       "wget". HTTP::Tinyish will auto-detect if the backend also supports
33       HTTPS, and use the appropriate backend based on the given URL to the
34       request methods.
35
36       For example, if you only have HTTP::Tiny but without SSL related
37       modules, it is possible that:
38
39         my $http = HTTP::Tinyish->new;
40
41         $http->get("http://example.com");  # uses HTTP::Tiny
42         $http->get("https://example.com"); # uses curl
43

COMPATIBILITIES

45       All request related methods such as "get", "post", "put", "delete",
46       "request", "patch" and "mirror" are supported.
47
48   LWP
49       •   LWP backend requires LWP 5.802 or over to be functional, and
50           LWP::Protocol::https to send HTTPS requests.
51
52       •   "mirror" method doesn't consider third options hash into account
53           (i.e. you can't override the HTTP headers).
54
55       •   proxy is automatically detected from environment variables.
56
57       •   "timeout", "max_redirect", "agent", "default_headers" and
58           "verify_SSL" are translated.
59
60   HTTP::Tiny
61       Because the actual HTTP::Tiny backend is used, all APIs are supported.
62
63   Curl
64       •   This module has been tested with curl 7.22 and later.
65
66       •   HTTPS support is automatically detected by running "curl --version"
67           and see its protocol output.
68
69       •   "timeout", "max_redirect", "agent", "default_headers" and
70           "verify_SSL" are supported.
71
72   Wget
73       •   This module requires Wget 1.12 and later.
74
75       •   Wget prior to 1.15 doesn't support sending custom HTTP methods, so
76           if you use "$http->put" for example, you'll get an internal error
77           response (599).
78
79       •   HTTPS support is automatically detected.
80
81       •   mirror() method doesn't send "If-Modified-Since" header to the
82           server, which will result in full-download every time because
83           "wget" doesn't support "--timestamping" combined with "-O" option.
84
85       •   "timeout", "max_redirect", "agent", "default_headers" and
86           "verify_SSL" are supported.
87

SIMILAR MODULES

89       •   File::Fetch - is core since 5.10. Has support for non-HTTP
90           protocols such as ftp and git. Does not support HTTPS or basic
91           authentication as of this writing.
92
93       •   Plient - provides more complete runtime API, but seems only
94           compatible on Unix environments. Does not support mirror() method.
95

AUTHOR

97       Tatsuhiko Miyagawa
98
100       Tatsuhiko Miyagawa, 2015-
101

LICENSE

103       This module is licensed under the same terms as Perl itself.
104
105
106
107perl v5.36.0                      2023-01-20                  HTTP::Tinyish(3)
Impressum