Acme-HTTP Version 0.07

Acme::HTTP - High-level access to Net::HTTP and Net::HTTPS

SYNOPSIS

  use Acme::HTTP;

  # you can use http:
  my $url = "http://perldoc.perl.org/perlfaq5.html";

  # ...or, alternatively, use https:
  #  $url = "https://metacpan.org/pod/Data::Dumper";

  set_redir_max(3); # Max. number of redirections
  set_timeout(10);  # Timeout in seconds

  my $obj = Acme::HTTP->new($url) || die $@;

  my $code = get_code();
  my $msg  = get_message();

  if ($code eq '404') {
      die "Page '$url' not found";
  }
  elsif ($code ne '200') {
      die "Page '$url' - Error $code, Msg '$msg'";
  }

  print "Orig url     = ", $url, "\n";
  print "Real url     = ", get_url_act(), "\n";
  print "Redirections = ", get_redir_act(), "\n";
  print "Length       = ", get_response()->{'Content-Length'} // 0, "\n";
  print "\n";

  while (1) {
      my $n = $obj->read_entity_body(my $buf, 4096);
      die "read failed: $@" unless defined $n;
      last unless $n;

      print $buf;
  }

INSTALLATION

    To install this module, run the following commands:

	perl Makefile.PL
	make
	make test
	make install

SUPPORT AND DOCUMENTATION

    After installing, you can find documentation for this module with the
    perldoc command.

    perldoc Acme::HTTP

You can also look for information at:

    RT, CPAN's request tracker
        http://rt.cpan.org/NoAuth/Bugs.html?Dist=Acme-HTTP

    AnnoCPAN, Annotated CPAN documentation
        http://annocpan.org/dist/Acme-HTTP

    CPAN Ratings
        http://cpanratings.perl.org/d/Acme-HTTP

    Search CPAN
        http://search.cpan.org/dist/Acme-HTTP/


AUTHOR

    Klaus Eichner <klaus03@gmail.com>

COPYRIGHT AND LICENSE

    Copyright (C) 2014 by Klaus Eichner

    All rights reserved. This program is free software; you can redistribute
    it and/or modify it under the terms of the artistic license 2.0,
    see http://www.opensource.org/licenses/artistic-license-2.0.php
