diff options
-rw-r--r-- | lib/TUWF/Response.pm | 4 | ||||
-rw-r--r-- | lib/TUWF/Response.pod | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/lib/TUWF/Response.pm b/lib/TUWF/Response.pm index bef3648..aa78efb 100644 --- a/lib/TUWF/Response.pm +++ b/lib/TUWF/Response.pm @@ -190,8 +190,8 @@ sub resJSON { croak "Unable to load JSON::XS, is it installed?\n" unless eval { require JSON::XS; 1 }; - $self->resInit; - $self->resHeader('Content-Type' => 'application/json'); + $self->resHeader('Content-Type' => 'application/json; charset=UTF-8'); + $self->resBuffer('clear'); my $fd = $self->resFd(); print $fd JSON::XS::encode_json($obj); } diff --git a/lib/TUWF/Response.pod b/lib/TUWF/Response.pod index 55bf14d..20d8261 100644 --- a/lib/TUWF/Response.pod +++ b/lib/TUWF/Response.pod @@ -178,9 +178,6 @@ you had to set these B<after> calling C<resRedirect()>. In TUWF versions after Sets the content type to C<application/json> and sends the encoded JSON object to the client. -C<resJSON()> calls C<resInit()>, so if you wish to send any additional headers -or cookies, you have to set these B<after> calling C<resJSON()>. - =head2 resBinary(data) Send binary data to the client. This method throws away any data currently |