Furl::Response(3pm)
π Furl::Response β the response object glow-up β¨
okay bestie, you're in Furl::Response(3pm) territory, which is part of the User Contributed Perl Documentation β yes that's the manual name, we're being fancy today π
πΈ NAME πΈ
Furl::Response β the Response object for Furl. it's giving "I hold all the answers your HTTP request was waiting for" π
π SYNOPSIS π
my $res = Furl::Response->new($minor_version, $code, $message, $headers, $content);
print $res->status, "\n";
look at that. one line to build it, one line to read the status. iconic behaviour fr fr β¨
π¦ DESCRIPTION π¦
so basically, this is the HTTP response object in Furl. that's it, that's the vibe. every request you send out into the world comes back as one of these π«Ά
π CONSTRUCTOR π
my $res = Furl::Response->new($minor_version, $code, $msg, \%headers, $content);
yep, you hand it the minor version, the code, the msg, a hashref of headers, and the content, and boom β response object, no cap π
π₯ INSTANCE METHODS π₯
$res->code$res->statusβ Returns HTTP status code. both of them, same energy, bestie π«$res->messageβ Returns HTTP status message.$res->headersβ Returns instance ofFurl::Headers.$res->content$res->bodyβ Returns response body in scalar. two names, one body, we love an alias π$res->decoded_contentβ this one will return the content after anyContent-Encodingand charsets have been decoded. SeeHTTP::Messagefor details. it's the "unwrapped and ready" version of your content π$res->requestβ Returns instance ofFurl::Requestrelated this response. yes, the response knows who its request was. soulmate behaviour π$res->content_length$res->content_type$res->content_encoding$res->headerβ Shorthand to accessFurl::Headers. quick lil shortcut, we love efficiency β¨$res->protocol
$res->protocol(); # => "HTTP/1.1"
Returns HTTP protocol in string.
$res->as_http_responseβ Make instance ofHTTP::ResponsefromFurl::Response. glow-up into a different class, we love to see it π$res->to_psgi()β Convert object to PSGI response. It's very useful to make proxy. proxy girlies rise up π$res->as_hashref()β Convert response object to HashRef.
Format is following:
code: Int
message: Str
protocol: Str
headers: ArrayRef[Str]
content: Str
$res->is_successβ Returns true if status code is 2xx. everything's fine, everything's slaying, no 4xx no 5xx just vibes π$res->status_line
$res->status_line() # => "200 OK"
Returns status line.
my $headers = $res->captured_req_headers() : Strβ Captured request headers in raw string.
This method is only for debugging. π
You can use this method if you are using capture_request parameter is true.
my $content = $res->captured_req_content() : Strβ Captured request content in raw string.
This method is only for debugging. π
You can use this method if you are using capture_request parameter is true.
and that's the whole page, bestie β every last method, alias, and debug-only secret, all accounted for π
this was Furl::Response(3pm) from the perl v5.40.1 docs, dated 2025-10-18. mwah, go forth and read your responses πΈβ¨
π¦ where this page comes from
- ubuntu resolute: libfurl-perl 3.15-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libfurl-perl 3.15-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms