HTTP::...extBody(3pm)
π HTTP::Throwable::Role::TextBody π
okay bestie, pull up a chair β this is the page for HTTP::Throwable::Role::TextBody, from the User Contributed Perl Documentation corner of the manual-verse. Yes the filename looks like somebody's cat walked across the keyboard (HTTP::...extBody), but the module name is the whole thing and we're gonna say it with our chest.
β¨ NAME β¨
HTTP::Throwable::Role::TextBody β it's an exception, but make it a plaintext body. An exception with a plaintext body, fr fr. π
πΈ VERSION πΈ
version 0.028
π¦ OVERVIEW π¦
Okay so this role is lowkey the simplest little guy and I'm obsessed with it. What it does is implement the required as_string, body, and body_headers methods for HTTP::Throwable. That's the whole job. Iconic, honestly. π
And in turn β because nothing in life is free β it requires that a text_body method be provided. So you gotta bring your own body text. It's giving potluck. π
When an HTTP::Throwable exception uses this role, here's the tea:
- its PSGI response gets a
text/plaincontent type β - the response body is whatever you get back from calling its
text_bodymethod - and it will also stringify to the text body β so when it gets stringified, you get the text body. That's it. That's the vibe. π
Bonus round: the role HTTP::Throwable::Role::BoringText can be genuinely useful here β it gives you a text_body method that just issues the status_line as the body. So if you're feeling lazy (no judgment, bestie, we've all been there π«Ά), that's your shortcut.
π PERL VERSION π
So like. This library should run on perls released even a long time ago. Like, ancient perls. Grandmother perls. And it should work on any version of perl released in the last five years. Slay. π¦
β οΈ BUT β and this is the important part, don't skip it β although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. So don't come for them with a patch to lower it. It's not happening. Periodt. π
π AUTHORS π
- Stevan Little
<stevan.little@iinteractive.com>π - Ricardo Signes
<cpan@semiotic.systems>π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2011 by Infinity Interactive, Inc. π«Ά
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. So go wild, respectfully. β¨
And that's the whole page, bestie!! This was perl v5.36.0, dated 2023-01-24, and yeah, the manual title is that goofy-looking HTTP::...extBody(3pm) β we love her anyway. Byeeee ππ¦πΈππ
π¦ where this page comes from
- debian bookworm: libhttp-throwable-perl 0.028-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libhttp-throwable-perl 0.028-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhttp-throwable-perl 0.028-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhttp-throwable-perl 0.028-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libhttp-throwable-perl 0.028-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