The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Pcore::HTTP::Server

SYNOPSIS

my $svr = Pcore::HTTP::Server->new(
    listen     => '//127.0.0.1:80',
    on_request => sub ($req) {
        return 200, [ 'Content-Type' => 'text/html' ], 'body';
    }
);

# asynchronous response
on_request => sub ($req) {
    async {
        $req->( 200, [ 'Content-Type' => 'text/html' ] );

        $req->('data1');

        $req->('data2');

        $req->finish;

        return;
    };

    return;
}

DESCRIPTION

ATTRIBUTES

METHODS

SEE ALSO