Mojo::Transaction::HTTP.3pm

Langue: en

Version: 2010-08-14 (fedora - 01/12/10)

Section: 3 (Bibliothèques de fonctions)

NAME

Mojo::Transaction::HTTP - HTTP 1.1 Transaction Container

SYNOPSIS

     use Mojo::Transaction::HTTP;
 
     my $tx = Mojo::Transaction::HTTP->new;
 
     my $req = $tx->req;
     my $res = $tx->res;
 
     my $keep_alive = $tx->keep_alive;
 
 

DESCRIPTION

Mojo::Transaction::HTTP is a container for HTTP 1.1 transactions as described in RFC 2616.

ATTRIBUTES

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

handler_cb

     my $cb = $tx->handler_cb;
     $tx    = $tx->handler_cb(sub {...});
 
 

Handler callback.

keep_alive

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

Connection can be kept alive.

req

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

HTTP 1.1 request.

res

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

HTTP 1.1 response.

upgrade_cb

     my $cb = $tx->upgrade_cb;
     $tx    = $tx->upgrade_cb(sub {...});
 
 

WebSocket upgrade callback.

METHODS

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

client_read

     $tx = $tx->client_read($chunk);
 
 

Read and process client data.

client_write

     my $chunk = $tx->client_write;
 
 

Write client data.

server_leftovers

     my $leftovers = $tx->server_leftovers;
 
 

Leftovers from the server request, used for pipelining.

server_read

     $tx = $tx->server_read($chunk);
 
 

Read and process server data.

server_write

     my $chunk = $tx->server_write;
 
 

Write server data.

SEE ALSO

Mojolicious, Mojolicious::Guides, <http://mojolicious.org>.