AnyEvent-REST-Server

 view release on metacpan or  search on metacpan

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

    301 => 'Moved Permanently',
    302 => 'Found',
    303 => 'See Other',
    304 => 'Not Modified',
    305 => 'Use Proxy',
    307 => 'Temporary Redirect',
    400 => 'Bad Request',
    401 => 'Unauthorized',
    402 => 'Payment Required',
    403 => 'Forbidden',
    404 => 'Not Found',
    405 => 'Method Not Allowed',
    406 => 'Not Acceptable',
    407 => 'Proxy Authentication Required',
    408 => 'Request Timeout',
    409 => 'Conflict',
    410 => 'Gone',
    411 => 'Length Required',
    412 => 'Precondition Failed',
    413 => 'Request Entity Too Large',
    414 => 'Request-URI Too Large',

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


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

    $self->{connections}{$id}{handle}->push_write($response);
}

sub send_not_found {
    shift->send(shift, 404, {}, '');
}

1;



( run in 1.292 second using v1.01-cache-2.11-cpan-39bf76dae61 )