Web::Machine::Util::BodyEncoding - Module to handle body encoding
version 0.07
use Web::Machine::Util::BodyEncoding;
This handles the body encoding.
encode_body_if_set ( $resource, $response, $metadata )
If the $response has a body, this will call encode_body.
$response
encode_body
encode_body ( $resource, $response, $metadata )
This will find the right encoding (from the 'Content-Encoding' entry in the $metadata HASH ref) adnd the right charset (from the 'Charset' entry in the $metadata HASH ref), then find the right transformers in the $resource. After that it will attempt to convert the charset and encode the body of the $response. Once completed it will set the Content-Length header in the response as well.
$metadata
$resource
Content-Length
NOTE: At the moment we do not correctly handle all the various body types that Plack supports, and we really on handle the case where the body is a simple string. We plan to add more support onto this later.
Stevan Little <stevan.little@iinteractive.com>
This software is copyright (c) 2012 by Infinity Interactive, Inc..
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Web::Machine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Web::Machine
CPAN shell
perl -MCPAN -e shell install Web::Machine
For more information on module installation, please visit the detailed CPAN module installation guide.