Net::A...Request(3pm)
π Net::Async::HTTP::Server::Request(3pm) π
okay bestie, welcome to the manual page for "Net::Async::HTTP::Server::Request" β and yes, the manual name is literally User Contributed Perl Documentation, so you know this one came straight from the community with love π«Ά. Strap in, we're doing async HTTP and we're doing it fabulously.
β¨ NAME β¨
"Net::Async::HTTP::Server::Request" β represents a single outstanding request π
πΈ DESCRIPTION πΈ
so basically, objects in this class represent a single outstanding request received by a Net::Async::HTTP::Server instance. it's giving β¨gatewayβ¨. It lets you get at all the data that came in from the web client, and it also lets you respond to it. main character energy fr fr.
π METHODS π
is_closed π
$is_closed = $request->is_closed;
Returns true if the underlying network connection for this request has already been closed. If that's the case, the application is free to drop the request object and do zero further processing on it. like, it's over, let it go π.
method π¦
$method = $request->method;
Return the method name from the request header. (yes, GET, POST, all the classics π )
path π
$path = $request->path;
Return the path name from the request header.
query_string π
$query_string = $request->query_string;
Return the query string from the request header.
query_form β
%params = $request->query_form;
Since version 0.09.
Return an even-sized list of name and value pairs that gives the decoded data in the query string. This is the same format as the same-named method on URI. so it's literally that vibe, no cap.
query_param_names π§
@names = $request->query_param_names;
Since version 0.09.
Return a list of the names of all the query parameters.
query_param π
$value = $request->query_param( $name );
@values = $request->query_param( $name );
Since version 0.09.
Return the value or values of a single decoded query parameter. one name, one or many values, she contains multitudes π .
protocol π₯
$protocol = $request->protocol;
Return the protocol version from the request header. This will be the full string, such as "HTTP/1.1". no shortcuts, we get the whole thing.
header πΈ
$value = $request->header( $key );
Return the value of a request header.
headers π
@headers = $request->headers;
Returns a list of 2-element "ARRAY" refs containing all the request headers. Each referenced array contains, in order, the name and the value. it's a little name/value duo, obsessed.
body π
$body = $request->body;
Return the body content from the request as a string of bytes.
write β¨
$request->write( $data );
Append more data to the response to be written to the client. $data can either be a plain string, or a "CODE" reference to be used in the underlying IO::Async::Stream's "write" method.
write_chunk π
$request->write_chunk( $data );
Append more data to the response in the form of an HTTP chunked-transfer chunk. This convenience is a shortcut wrapper for prepending the chunk header. cute little shortcut, we love her π«Ά.
done π―
$request->done;
Marks this response as completed. periodt.
write_chunk_eof π
$request->write_chunk_eof;
Sends the final EOF chunk and marks this response as completed. the grand finale, iconic.
as_http_request π¦
$req = $request->as_http_request;
Returns the data of the request as an HTTP::Request object.
respond π
$request->respond( $response );
Respond to the request using the given HTTP::Response object.
respond_chunk_header π
$request->respond_chunk_header( $response );
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 "write_chunk" will send another chunk of data. "write_chunk_eof" will send the final EOF chunk and mark the request as complete.
If the $response already contained content, that will be sent as one chunk immediately after the header is sent. sneaky little bonus chunk, slay.
stream π
$stream = $request->stream;
Returns the IO::Async::Stream object representing this connection. Usually this would be used for such things as inspecting the client's connection address on the "read_handle" of the stream.
ngl bestie, it should not be necessary to directly perform IO operations on this stream itself. so likeβ¦ look, don't touch π.
response_status_line β
$status = $request->response_status_line;
If a response header has been written by calling the "write" method, returns the first line of it.
response_status_code π’
$code = $request->response_status_code;
If a response header has been written by calling the "write" method, returns the status code from it.
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk> β king behaviour honestly, thank you for your service π
and that's the whole page, bestie!! this one shipped as perl v5.42.0, dated 2025-07-25, and yes it's still the Net::A...Request(3pm) page you know and love β go forth and respond to requests, you've got this ππβ¨
π¦ where this page comes from
- fedora 43: perl-Net-Async-HTTP-Server 0.15-2.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms