Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better synopsis examples for transactions

  • Loading branch information...
commit 6ec08a70bcc47a72012ea0cb8c2195a71d322091 1 parent e6634f3
@kraih authored
View
1  Changes
@@ -1,6 +1,7 @@
3.30 2012-08-14
- Added te method to Mojo::Headers.
+ - Improved documentation.
- Fixed small content encoding bug in Mojo::Message.
3.29 2012-08-13
View
2  lib/Mojo/Transaction/HTTP.pm
@@ -242,12 +242,14 @@ Mojo::Transaction::HTTP - HTTP transaction
say $tx->res->code;
say $tx->res->headers->content_type;
say $tx->res->body;
+ say $tx->remote_address;
# Server
my $tx = Mojo::Transaction::HTTP->new;
say $tx->req->method;
say $tx->req->url->to_abs;
say $tx->req->headers->accept;
+ say $tx->remote_address;
$tx->res->code(200);
$tx->res->headers->content_type('text/plain');
$tx->res->body('Hello World!');
View
4 lib/Mojo/Transaction/WebSocket.pm
@@ -314,6 +314,10 @@ Mojo::Transaction::WebSocket - WebSocket transaction
my ($ws, $message) = @_;
say "Message: $message";
});
+ $ws->on(finish => sub {
+ my $ws = shift;
+ say 'WebSocket closed.';
+ });
=head1 DESCRIPTION
Please sign in to comment.
Something went wrong with that request. Please try again.