Man pages sections > man3 > Catalyst::Response::Writer

Catalyst::Response::Writer - Proxy over the PSGI Writer

Catalyst::Response::Writer(3pm) User Contributed Perl Documentation Catalyst::Response::Writer(3pm)


Catalyst::Response::Writer - Proxy over the PSGI Writer


    sub myaction : Path {
      my ($self, $c) = @_;
      my $w = $c->response->writer_fh;
      $w->write("hello world");


This wraps the PSGI writer (see PSGI.pod\Delayed-Response-and-Streaming-Body) for more. We wrap this object so we can provide some additional methods that make sense from inside Catalyst


This class does the following methods



These delegate to the underlying PSGI writer object


If the application defines a response encoding (default is UTF8) and the content type is a type that needs to be encoded (text types like HTML or XML and Javascript) we first encode the line you want to write. This is probably the thing you want to always do. If you use the \write method directly you will need to handle your own encoding.


Catalyst Contributors, see This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.
2017-07-11 perl v5.24.1