The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Async::HTTP::Server::Request - represents a single outstanding request

DESCRIPTION

Objects in this class represent a single outstanding request received by a Net::Async::HTTP::Server instance. It allows access to the data received from the web client and allows responding to it.

METHODS

$method = $request->method

Return the method name from the request header.

$path = $request->path

Return the path name from the request header.

$protocol = $request->protocol

Return the protocol version from the request header. This will be the full string, such as HTTP/1.1.

$body = $request->body

Return the body content from the request as a string of bytes.

$req = $request->as_http_request

Returns the data of the request as an HTTP::Request object.

$request->respond( $response )

Respond to the request using the given HTTP::Response object.

$request->respond_chunk_header( $response )

$request->respond_chunk( $data )

$request->respond_chunk_eof

Respond to the request using the given HTTP::Response object to send in HTTP/1.1 chunked encoding mode.

The headers in the $response will be sent (which will be modified to set the Transfer-Encoding header). Each call to respond_chunk will send another chunk of data. respond_chunk_eof will send the final EOF chunk.

If the $response already contained content, that will be sent as one chunk immediately after the header is sent.

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>