<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package OAuth::Lite2::Agent;

use strict;
use warnings;

use LWP::UserAgent;

=head1 NAME

OAuth::Lite2::Agent - Base class of preset-agents.

=head1 SYNOPSIS

    my $agent = OAuth::Lite2::Client::Agent-&gt;new;
    my $res = $agent-&gt;request( $req );

=head1 DESCRIPTION

Base class of preset-agents.

=head1 METHODS

=head2 new (%args)

Constructor you can set 'agent' that has same 'request' interface method as LWP::UserAgent.
If you omit that, a simple LWP::UserAgent object is set by default.

    my $agent = $class-&gt;new( agent =&gt; YourCustomAgent-&gt;new );

=cut

sub new {
    my $class = shift;
    my $self = bless { @_ }, $class;
    unless ($self-&gt;{agent}) {
        $self-&gt;{agent} = LWP::UserAgent-&gt;new;
        $self-&gt;{agent}-&gt;agent(
            join "/",
                __PACKAGE__,
                $OAuth::Lite2::Client::VERSION
        );
    }
    return $self;
}

=head2 request ($req)

Returns L&lt;HTTP::Response&gt; object.

=cut

sub request {
    my ($self, $req) = @_;
    return $self-&gt;{agent}-&gt;request($req);
}

1;

=head1 SEE ALSO

L&lt;OAuth::Lite2::Client::Agent::Dump&gt;,
L&lt;OAuth::Lite2::Client::Agent::Strict&gt;

=head1 AUTHOR

Lyo Kato, C&lt;lyo.kato _at_ gmail.com&gt;

=head1 COPYRIGHT AND LICENSE

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.8 or,
at your option, any later version of Perl 5 you may have available.

=cut
</pre></body></html>