Cataly...Writer(3pm)
π NAME π
Catalyst::Response::Writer β it's literally a lil proxy sitting on top of the PSGI Writer, no cap π
β¨ SYNOPSIS β¨
okay bestie, here's the whole vibe:
sub myaction : Path {
my ($self, $c) = @_;
my $w = $c->response->writer_fh;
$w->write("hello world");
$w->close;
}
see? iconic. that's it. that's the whole thing. π
πΈ DESCRIPTION πΈ
so this thing wraps the PSGI writer (peep PSGI.pod\Delayed-Response-and-Streaming-Body if you want the full lore, it's giving required reading). why tho? because we wrap that object so we can hand you some extra methods that actually make sense from inside Catalyst. like, the PSGI writer is out here being all low-level and we're just adding a little sparkle on top so it plays nice with your app. π¦
π METHODS π
this class does the following methods, and yes they all ate:
π« write
π« close
these two are delegating girlies β they just pass everything straight through to the underlying PSGI writer object. no extra drama, no notes. they do exactly what the PSGI writer does, because they are the PSGI writer's methods, just proxied. π«Ά
π« write_encoded
okay so THIS one is the main character. listen up. π₯
if your application defines a response encoding (the default is UTF8, bestie) and the content type is a type that needs to be encoded β think text types like HTML or XML, plus Javascript β then we encode the line you want to write first, before it goes anywhere. β¨
this is probably the thing you want to always do. fr fr. it's the one. π
but if you use the write method directly? yeah you're on your own for encoding, bestie π you will need to handle your own encoding. no safety net. good luck and stay safe out there.
π AUTHORS π
Catalyst Contributors, see Catalyst.pm π
π COPYRIGHT π
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. slay, open source, we love to see it. π
and that's the whole page, babes β this was pulled from perl v5.40.0, dated 2024-11-15, straight outta the User Contributed Perl Documentation section. mwah, go stream some responses ππ¦β¨
π¦ where this page comes from
- debian trixie: libcatalyst-perl 5.90132-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatalyst-perl 5.90132-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatalyst-perl 5.90132-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