.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Web::Machine::Util::BodyEncoding 3pm" .TH Web::Machine::Util::BodyEncoding 3pm 2024-03-08 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Web::Machine::Util::BodyEncoding \- Module to handle body encoding .SH VERSION .IX Header "VERSION" version 0.17 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Web::Machine::Util::BodyEncoding; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This handles the body encoding. .SH FUNCTIONS .IX Header "FUNCTIONS" .ie n .IP """encode_body_if_set ( $resource, $response, $metadata )""" 4 .el .IP "\f(CWencode_body_if_set ( $resource, $response, $metadata )\fR" 4 .IX Item "encode_body_if_set ( $resource, $response, $metadata )" If the \f(CW$response\fR has a body, this will call \f(CW\*(C`encode_body\*(C'\fR. .ie n .IP """encode_body ( $resource, $response, $metadata )""" 4 .el .IP "\f(CWencode_body ( $resource, $response, $metadata )\fR" 4 .IX Item "encode_body ( $resource, $response, $metadata )" This will find the right encoding (from the 'Content\-Encoding' entry in the \f(CW$metadata\fR HASH ref) and the right charset (from the 'Charset' entry in the \f(CW$metadata\fR HASH ref), then find the right transformers in the \f(CW$resource\fR. After that it will attempt to convert the charset and encode the body of the \f(CW$response\fR. Once completed it will set the \f(CW\*(C`Content\-Length\*(C'\fR header in the response as well. .Sp \&\fBCAVEAT:\fR Note that currently this subroutine doesn't do anything when the body is returned as a CODE ref. This is a bug to be remedied in the future. .SH SUPPORT .IX Header "SUPPORT" bugs may be submitted through . .SH AUTHORS .IX Header "AUTHORS" .IP \(bu 4 Stevan Little .IP \(bu 4 Dave Rolsky .SH "COPYRIGHT AND LICENCE" .IX Header "COPYRIGHT AND LICENCE" This software is copyright (c) 2016 by Infinity Interactive, Inc. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.