NAME

Mojo::Transaction - Transaction

SYNOPSIS

use Mojo::Transaction;

my $tx = Mojo::Transaction->new;

my $req = $tx->req;
my $res = $tx->res;

my $keep_alive = $tx->keep_alive;

DESCRIPTION

Mojo::Transaction is a container for HTTP transactions.

ATTRIBUTES

Mojo::Transaction inherits all attributes from Mojo::Stateful and implements the following new ones.

connection

my $connection = $tx->connection;
$tx            = $tx->connection($connection);

continued

my $continued = $tx->continued;
$tx           = $tx->continued(1);

keep_alive

my $keep_alive = $tx->keep_alive;
my $keep_alive = $tx->keep_alive(1);

req

request

my $req = $tx->req;
my $req = $tx->request;
$tx     = $tx->request(Mojo::Message::Request->new);

res

response

my $res = $tx->res;
my $res = $tx->response;
$tx     = $tx->response(Mojo::Message::Response->new);

METHODS

Mojo::Transaction inherits all methods from Mojo::Stateful and implements the following new ones.

new_delete

my $tx = Mojo::Transaction->new_delete('http://127.0.0.1',
    User-Agent => 'Mojo'
);
my $tx = Mojo::Transaction->new_delete('http://127.0.0.1', {
    User-Agent => 'Mojo'
});

new_get

my $tx = Mojo::Transaction->new_get('http://127.0.0.1',
    User-Agent => 'Mojo'
);
my $tx = Mojo::Transaction->new_get('http://127.0.0.1', {
    User-Agent => 'Mojo'
});

new_head

my $tx = Mojo::Transaction->new_head('http://127.0.0.1',
    User-Agent => 'Mojo'
);
my $tx = Mojo::Transaction->new_head('http://127.0.0.1', {
    User-Agent => 'Mojo'
});

new_post

my $tx = Mojo::Transaction->new_post('http://127.0.0.1',
    User-Agent => 'Mojo'
);
my $tx = Mojo::Transaction->new_post('http://127.0.0.1', {
    User-Agent => 'Mojo'
});

new_put

my $tx = Mojo::Transaction->new_put('http://127.0.0.1',
    User-Agent => 'Mojo'
);
my $tx = Mojo::Transaction->new_put('http://127.0.0.1', {
    User-Agent => 'Mojo'
});