Furl::Response(3pm)

πŸ“¦
version 3.15 Β· 3 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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 of Furl::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 any Content-Encoding and charsets have been decoded. See HTTP::Message for details. it's the "unwrapped and ready" version of your content 🎁
  • $res->request β€” Returns instance of Furl::Request related 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 access Furl::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 of HTTP::Response from Furl::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