1Mojo::Transaction::HTTPU(s3e)r Contributed Perl DocumentaMtoijoon::Transaction::HTTP(3)
2
3
4
6 Mojo::Transaction::HTTP - HTTP 1.1 Transaction Container
7
9 use Mojo::Transaction::HTTP;
10
11 my $tx = Mojo::Transaction::HTTP->new;
12
13 my $req = $tx->req;
14 my $res = $tx->res;
15
16 my $keep_alive = $tx->keep_alive;
17
19 Mojo::Transaction::HTTP is a container for HTTP 1.1 transactions as
20 described in RFC 2616.
21
23 Mojo::Transaction::HTTP inherits all attributes from Mojo::Transaction
24 and implements the following new ones.
25
26 "handler_cb"
27 my $cb = $tx->handler_cb;
28 $tx = $tx->handler_cb(sub {...});
29
30 Handler callback.
31
32 "keep_alive"
33 my $keep_alive = $tx->keep_alive;
34 $tx = $tx->keep_alive(1);
35
36 Connection can be kept alive.
37
38 "req"
39 my $req = $tx->req;
40 $tx = $tx->req(Mojo::Message::Request->new);
41
42 HTTP 1.1 request.
43
44 "res"
45 my $res = $tx->res;
46 $tx = $tx->res(Mojo::Message::Response->new);
47
48 HTTP 1.1 response.
49
50 "upgrade_cb"
51 my $cb = $tx->upgrade_cb;
52 $tx = $tx->upgrade_cb(sub {...});
53
54 WebSocket upgrade callback.
55
57 Mojo::Transaction::HTTP inherits all methods from Mojo::Transaction and
58 implements the following new ones.
59
60 "client_read"
61 $tx = $tx->client_read($chunk);
62
63 Read and process client data.
64
65 "client_write"
66 my $chunk = $tx->client_write;
67
68 Write client data.
69
70 "server_leftovers"
71 my $leftovers = $tx->server_leftovers;
72
73 Leftovers from the server request, used for pipelining.
74
75 "server_read"
76 $tx = $tx->server_read($chunk);
77
78 Read and process server data.
79
80 "server_write"
81 my $chunk = $tx->server_write;
82
83 Write server data.
84
86 Mojolicious, Mojolicious::Guides, <http://mojolicious.org>.
87
88
89
90perl v5.12.3 2010-08-14 Mojo::Transaction::HTTP(3)