HTTP::...extBody(3pm)

πŸ“¦
version 0.028 Β· 2 versions
  • 0.028 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.027 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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/plain content type β˜•
  • the response body is whatever you get back from calling its text_body method
  • 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 🌟

  1. Stevan Little <stevan.little@iinteractive.com> πŸ’œ
  2. Ricardo Signes <cpan@semiotic.systems> πŸ’œ

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