WWW::Postini::UserAgent - HTTP user agent with access to last response


WWW-Postini documentation Contained in the WWW-Postini distribution.

Index


Code Index:

NAME

Top

WWW::Postini::UserAgent - HTTP user agent with access to last response

SYNOPSIS

Top

  use WWW::Postini::UserAgent;
  my $ua = new WWW::Postini::UserAgent();

DESCRIPTION

Top

Nearly identical in functionality to its parent class, LWP::UserAgent, this module additionally provides access to the last response it processed. This extra feature is intended to assist with updating WWW::Postini in the event of service upgrades on Postini's part.

CONSTRUCTOR

Top

See LWP::UserAgent for more information

OBJECT METHODS

Top

last_response()

Return the last response processed by the user agent

SEE ALSO

Top

WWW::Postini, LWP::UserAgent

AUTHOR

Top

Peter Guzis, <pguzis@cpan.org>

COPYRIGHT AND LICENSE

Top


WWW-Postini documentation Contained in the WWW-Postini distribution.

package WWW::Postini::UserAgent;

use strict;
use warnings;

use HTTP::Cookies;
use LWP::UserAgent;

use vars qw( @ISA $VERSION );

@ISA = qw( LWP::UserAgent );
$VERSION = '0.01';

sub new {

	my $class = shift;
	$class->SUPER::new(cookie_jar => new HTTP::Cookies, @_);

}

sub request {

	my $self = shift;
	my $response = $self->SUPER::request(@_);
	$self->{'_last_response'} = $response;

}

sub post {

	my $self = shift;
	my $response = $self->SUPER::post(@_);
	$self->{'_last_response'} = $response;

}

sub get {

	my $self = shift;
	my $response = $self->SUPER::get(@_);
	$self->{'_last_response'} = $response;

}

sub head {

	my $self = shift;
	my $response = $self->SUPER::head(@_);
	$self->{'_last_response'} = $response;

}

sub simple_request {

	my $self = shift;
	my $response = $self->SUPER::simple_request(@_);
	$self->{'_last_response'} = $response;

}

sub send_request {

	my $self = shift;
	my $response = $self->SUPER::send_request(@_);
	$self->{'_last_response'} = $response;

}

sub last_response { shift->{'_last_response'}; }

1;

__END__