AnyEvent-REST-Server
view release on metacpan or search on metacpan
lib/AnyEvent/REST/Server.pm view on Meta::CPAN
$self->read_http_command($id);
}
);
}
sub read_http_command {
my ($self, $id) = @_;
$self->{connections}{$id}{handle}->push_read(
regex => qr<(GET|POST|PUT|DELETE)\s+([^ ]+)\s+HTTP/(\d.\d)\r?\n>,
sub {
my ($handle, $data) = @_;
$self->{connections}{$id}{command} = $1;
$self->{connections}{$id}{location} = $2;
$self->{connections}{$id}{version} = $3;
if ($self->{connections}{$id}{location} =~ /(.*)\/$/) {
$self->{connections}{$id}{location} = $1;
}
( run in 0.365 second using v1.01-cache-2.11-cpan-4e96b696675 )