5 my $cvar = AnyEvent
->condvar;
7 my $httpd = AnyEvent
::HTTPD
->new (port
=> 19090);
11 my ($httpd, $req) = @_;
13 $req->respond ({ content
=> [ 'text/html',
14 "<html><body><h1>Testing return types...</h1>"
15 . "<img src=\"/image/bshttp.png\" />"
19 '/image/bshttp.png' => sub {
22 open IMG
, 'bshttp.png'
23 or do { $_[1]->respond (
24 [404, 'not found', { 'Content-Type' => 'text/plain' }, 'Fail!']);
26 $_[1]->respond ({ content
=> [ 'image/png', do { local $/; <IMG
> } ] });