1 package Catalyst::Response::Writer;
3 sub write { shift->{_writer}->write(@_) }
4 sub close { shift->{_writer}->close }
7 my ($self, $line) = @_;
8 if((my $enc = $self->{_context}->encoding) && $self->{_requires_encoding}) {
9 # Not going to worry about CHECK arg since Unicode always croaks I think - jnap
10 $line = $enc->encode($line);
18 Catalyst::Response::Writer - Proxy over the PSGI Writer
24 my $w = $c->response->writer_fh;
26 $w->write("hello world");
32 This wraps the PSGI writer (see L<PSGI.pod\Delayed-Response-and-Streaming-Body>)
33 for more. We wrap this object so we can provide some additional methods that
34 make sense from inside L<Catalyst>
38 This class does the following methods
44 These delegate to the underlying L<PSGI> writer object
48 If the application defines a response encoding (default is UTF8) and the
49 content type is a type that needs to be encoded (text types like HTML or XML and
50 Javascript) we first encode the line you want to write. This is probably the
51 thing you want to always do. If you use the L<\write> method directly you will
52 need to handle your own encoding.
56 Catalyst Contributors, see Catalyst.pm
60 This library is free software. You can redistribute it and/or modify
61 it under the same terms as Perl itself.