| Mojolicious documentation | view source | Contained in the Mojolicious distribution. |
Mojo::Transaction::HTTP - HTTP 1.1 Transaction Container
use Mojo::Transaction::HTTP; my $tx = Mojo::Transaction::HTTP->new; my $req = $tx->req; my $res = $tx->res; my $keep_alive = $tx->keep_alive;
Mojo::Transaction::HTTP is a container for HTTP 1.1 transactions as described in RFC 2616.
Mojo::Transaction::HTTP inherits all attributes from Mojo::Transaction and implements the following new ones.
on_upgrade my $cb = $tx->on_upgrade;
$tx = $tx->on_upgrade(sub {...});
Callback to be invoked for WebSocket upgrades.
on_request my $cb = $tx->on_request;
$tx = $tx->on_request(sub {...});
Callback to be invoked for requests.
reqmy $req = $tx->req; $tx = $tx->req(Mojo::Message::Request->new);
HTTP 1.1 request, by default a Mojo::Message::Request object.
resmy $res = $tx->res; $tx = $tx->res(Mojo::Message::Response->new);
HTTP 1.1 response, by default a Mojo::Message::Response object.
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_writemy $chunk = $tx->client_write;
Write client data.
keep_alivemy $keep_alive = $tx->keep_alive; $tx = $tx->keep_alive(1);
Connection can be kept alive.
server_leftoversmy $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_writemy $chunk = $tx->server_write;
Write server data.
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
| Mojolicious documentation | view source | Contained in the Mojolicious distribution. |