Acme-HTTP

 view release on metacpan or  search on metacpan

lib/Acme/HTTP.pm  view on Meta::CPAN

Set the timout in seconds

=back

=head1 RETURN VALUES

The following variables are available read-only after new():

=over

=item get_url_act()

returns the actual url after redirection

=item get_redir_act()

returns the actual number of redirection that have taken place

=item get_code()

returns the HTTP status

=item get_message()

returns the HTTP message

=item get_response()

returns a hash-reference of the response variables

=back

=head2 List of values

In case of a successful new(), the subroutines get_code() and
get_message() are usually set as follows:

  get_code()    => '200'
  get_message() => 'OK'

However, a non-existing address would typically return different values:

  get_code()    => '404'
  get_message() => 'Not Found'

Here is one sample result of get_response() of an MP3 file:

  'Content-Type'   => 'audio/mpeg'
  'Content-Length' => '28707232'
  'Date'           => 'Sun, 17 Aug 2014 10:53:43 GMT'
  'Last-Modified'  => 'Thu, 10 Jul 2014 04:52:52 GMT'
  'Accept-Ranges'  => 'bytes'
  'Connection'     => 'close'

  'Cache-Control'  => 'max-age=2269915'
  'ETag'           => '"1404967972"'
  'X-HW'           => '1408272823.dop...pa1.c'

...and here is another example result of get_esponse() of a web page:

  'Content-Type'   => 'text/html; charset=utf-8'
  'Content-Length' => '31569'
  'Date'           => 'Sun, 17 Aug 2014 11:02:54 GMT'
  'Last-Modified'  => 'Thu, 24 Jul 2014 03:31:45 GMT'
  'Accept-Ranges'  => 'bytes'
  'Connection'     => 'close'

  'Age'            => '0'
  'Set-Cookie'     => '...expires=12-Sep-2031...; secure',
  'Server'         => 'nginx/0.7.67',
  'Vary'           => 'Accept-Encoding,Cookie'
  'Via'            => '1.1 varnish',
  'X-Cache'        => 'MISS, MISS',
  'X-Cache-Hits'   => '0, 0',
  'X-Runtime'      => '0.479137'
  'X-Served-By'    => 'cache-lo80-LHR, cache-fra1222-FRA',

=head1 AUTHOR

Klaus Eichner <klaus03@gmail.com>

=head1 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

=cut



( run in 0.596 second using v1.01-cache-2.11-cpan-13bb782fe5a )