6
my $cvar = AnyEvent->condvar;
8
my $httpd = AnyEvent::HTTPD->new (port => 19090);
13
my ($httpd, $req) = @_;
15
$req->respond ({ content => [ 'text/html',
16
"<html><body><h1>Testing return types...</h1>"
17
. "<img src=\"/image/bshttp.png\" />"
21
'/image/bshttp.png' => sub {
22
my ($httpd, $req) = @_;
25
$timer = AnyEvent->timer (after => 3, cb => sub {
26
open IMG, 'bshttp.png' or do { $req->respond; return }; # respond without output will
28
$req->respond ({ content => [ 'image/png', do { local $/; <IMG> } ] });