AnyEvent-REST-Server

 view release on metacpan or  search on metacpan

lib/AnyEvent/REST/Server.pm  view on Meta::CPAN

        }
    }
}

sub send {
    my ($self, $id, $code, $custom_header, $body) = @_;

    my $HTTP_EOL = "\r\n";

    my $header = {
        'Cache-Control' => 'max-age=0, no-cache, must-revalidate, proxy-revalidate, private',
        'Pragma' => 'no-cache',
        'Content-Type' => 'application/octet-stream',
        %$custom_header,
        'Content-Length' => length($body),
        'Server' => $self->{name},
    };

    my $response = 'HTTP/'.$self->{connections}{$id}{version}.' '.$code.' '.$HTTP_CODE_TEXT->{$code}.$HTTP_EOL;
    $response .= "$_: $header->{$_}$HTTP_EOL" foreach (keys %$header);
    $response .= $HTTP_EOL;



( run in 0.464 second using v1.01-cache-2.11-cpan-a5abf4f5562 )