SYNOPSIS

     use HTTP::Tiny::CLI;
    
     my $response = HTTP::Tiny::CLI->new->get('http://example.com/');
    
     die "Failed!\n" unless $response->{success};
    
     print "$response->{status} $response->{reason}\n";
    
     while (my ($k, $v) = each %{$response->{headers}}) {
         for (ref $v eq 'ARRAY' ? @$v : $v) {
             print "$k: $_\n";
         }
     }
    
     print $response->{content} if length $response->{content};

DESCRIPTION

    NOTE: EARLY RELEASE. Many features like wget support, redirects, post
    data, cookies are not yet implemented.

    This class lets you use CLI network clients (currently curl and wget
    are supported) with an HTTP::Tiny interface. It is an alternative you
    can try when you must connect to https but IO::Socket::SSL is not
    available (and you cannot build it because there is no C compiler on
    the system).

    Note that this is not a subclass of HTTP::Tiny, but a look-alike
    object. Some features of HTTP::Tiny are not supported or are
    implemented differently: XXX.

METHODS

new(%attributes) => obj

    Aside from attributes known by HTTP::Tiny, there are additional
    attributes:

      * cli_search_order => str

      A comma-separated list of CLI program names to search, in order.
      Currently only wget and curl are supported. Either 'curl', 'wget',
      'curl,wget' or 'wget,curl'. The default is 'curl,wget'.

      * curl_path => str

      Set path to curl. The default is to search for "curl" in PATH.

      * wget_path => str

      Set path to wget. The default is to search for "wget" in PATH.

CAVEATS

    This module is currently not exactly "tiny": it depends on a couple of
    non-core modules.

    Some information (like "user:password" stanza in URL) might leak
    because it is specified in command line which might be visible from ps
    or other process-table tools.

SEE ALSO

    HTTP::Tiny

