Dancer2::Core::Response - Response object for Dancer2
Flag to tell if the content has already been encoded.
Flag to tell whether or not the response should continue to be processed.
The HTTP status for the response.
The content for the response, stored as a string. If a reference is passed, the response will try coerce it to a string via double quote interpolation.
Whenever the content changes, it recalculates and updates the Content-Length header, unless the response has_passed.
Set or returns the optional serializer object used to deserialize request parameters
Shortcut to halt the current response by setting the is_halted flag.
Encodes the stored content according to the stored content_type.
If the content_type is a text format
then no encoding will take place.
Interally, it uses the is_encoded flag to make sure that content is not encoded twice.
If it encodes the content,
then it will return the encoded content.
In all other cases it returns
Converts the response object to a PSGI array.
A little sugar for setting or accessing the content_type of the response, via the headers.
Sets a header in this response to give a redirect to $destination, and sets the status to $status. If $status is omitted, or false, then it defaults to a status of 302.
$response->error( message => "oops" );
Creates a Dancer2::Core::Error object with the given @args and throw() it against the response object. Returns the error object.
Dancer Core Developers
This software is copyright (c) 2013 by Alexis Sukrieh.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.