.\" -*- 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 "Param 3pm" .TH Param 3pm 2024-02-05 "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 APR::Request::Param \- wrapper for libapreq2's param API. .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use APR::Request::Param; \& \& $arg1 = $req\->args(\*(Aqalpha\*(Aq); \& $body = $req\->body; \& $body\->param_class("APR::Request::Param"); \& ok $_\->isa("APR::Request::Param") for values %$body; \& \& @uploads = grep {$_\->upload} values %$body; \& $param = $body\->get(\*(Aqbeta\*(Aq); \& $param\->upload_slurp(my $content); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" The \f(CW\*(C`APR::Request::Param\*(C'\fR module provides base methods for interfacing with libapreq2's param API. It also provides a few utility functions and constants. .PP This manpage documents version 2.17 of the APR::Request::Param, APR::Request::Brigade, and APR::Request::Brigade::IO packages. .SH OVERLOADS .IX Header "OVERLOADS" APR::Request::Param .SS """""" .IX Subsection """""" .Vb 1 \& "$param" .Ve .PP The double-quote interpolation operator maps to \&\f(CWAPR::Request::Param::value()\fR. .SH METHODS .IX Header "METHODS" APR::Request::Param .SS name .IX Subsection "name" .Vb 1 \& $param\->name() .Ve .PP Returns the param's name. This attribute cannot be modified. .SS value .IX Subsection "value" .Vb 1 \& $param\->value() .Ve .PP Returns the param's value. This attribute cannot be modified. .SS is_tainted .IX Subsection "is_tainted" .Vb 2 \& $param\->is_tainted() \& $param\->is_tainted($set) .Ve .PP Get/set the param's internal tainted flag. Note: if the param's charset is APREQ_CHARSET_UTF8 (8), this also activates the SvUTF8_on flag during calls to \fBname()\fR and/or \fBvalue()\fR. .PP .Vb 3 \& $tainted = $param\->is_tainted; \& $param\->is_tainted(0); \& ok $param\->is_tainted == 0; .Ve .SS charset .IX Subsection "charset" .Vb 2 \& $param\->charset() \& $param\->charset($set) .Ve .PP Get/set the param's internal charset. The charset is a number between 0 and 255; the current recognized values are .IP "0 APREQ_CHARSET_ASCII (7\-bit us-ascii)" 4 .IX Item "0 APREQ_CHARSET_ASCII (7-bit us-ascii)" .PD 0 .IP "1 APREQ_CHARSET_LATIN1 (8\-bit iso\-8859\-1)" 4 .IX Item "1 APREQ_CHARSET_LATIN1 (8-bit iso-8859-1)" .IP "2 APREQ_CHARSET_CP1252 (8\-bit Windows\-1252)" 4 .IX Item "2 APREQ_CHARSET_CP1252 (8-bit Windows-1252)" .IP "8 APREQ_CHARSET_UTF8 (utf8 encoded Unicode)" 4 .IX Item "8 APREQ_CHARSET_UTF8 (utf8 encoded Unicode)" .PD .PP See is_tainted above for info about how APREQ_CHARSET_UTF8 relates to perl's UTF\-8 flag. .PP .Vb 3 \& $charset = $param\->charset; \& $param\->charset(2); \& ok $param\->charset == 2; .Ve .SS make .IX Subsection "make" .Vb 1 \& APR::Request::Param\->make($pool, $name, $value) .Ve .PP Fast XS param constructor. .SS info .IX Subsection "info" .Vb 2 \& $param\->info() \& $param\->info($set) .Ve .PP Get/set the APR::Table headers for this param. .SS upload .IX Subsection "upload" .Vb 2 \& $param\->upload() \& $param\->upload($set) .Ve .PP Get/set the APR::Brigade file-upload content for this param. .SS upload_filename .IX Subsection "upload_filename" .Vb 1 \& $param\->upload_filename() .Ve .PP Returns the client-side filename associated with this param. .SS upload_link .IX Subsection "upload_link" .Vb 1 \& $param\->upload_link($path) .Ve .PP Links the file-upload content with the local file named \f(CW$path\fR. Creates a hard-link if the spoolfile's (see upload_tempname) temporary directory is on the same device as \f(CW$path\fR; otherwise this writes a copy. .SS upload_slurp .IX Subsection "upload_slurp" .Vb 1 \& $param\->upload_slurp($data) .Ve .PP Reads the entire file-upload content into \f(CW$data\fR. .SS upload_size .IX Subsection "upload_size" .Vb 1 \& $param\->upload_size() .Ve .PP Returns the size of the param's file-upload content. .SS upload_type .IX Subsection "upload_type" .Vb 1 \& $param\->upload_type() .Ve .PP Returns the MIME-type of the param's file-upload content. .SS upload_tempname .IX Subsection "upload_tempname" .Vb 1 \& $param\->upload_tempname() .Ve .PP Returns the name of the local spoolfile for this param. .SS upload_io .IX Subsection "upload_io" .Vb 1 \& $param\->upload_io() .Ve .PP Returns an APR::Request::Brigade::IO object, which can be treated as a non-seekable IO stream. .SS upload_fh .IX Subsection "upload_fh" .Vb 1 \& $param\->upload_fh() .Ve .PP Returns a seekable filehandle representing the file-upload content. .SH METHODS .IX Header "METHODS" APR::Request::Brigade .PP This class is derived from APR::Brigade, providing additional methods for TIEHANDLE, READ and READLINE. To be memory efficient, these methods delete buckets from the brigade as soon as their data is actually read, so you cannot \f(CW\*(C`seek\*(C'\fR on handles tied to this class. Such handles have semantics similar to that of a read-only socket. .SS "new, TIEHANDLE" .IX Subsection "new, TIEHANDLE" .Vb 1 \& APR::Request::Brigade\->TIEHANDLE($bb) .Ve .PP Creates a copy of the bucket brigade represented by \f(CW$bb\fR, and blesses that copy into the APR::Request::Brigade class. This provides syntactic sugar for using perl's builtin \f(CW\*(C`read\*(C'\fR, \f(CW\*(C`readline\*(C'\fR, and \f(CW\*(C`<>\*(C'\fR operations on handles tied to this package: .PP .Vb 4 \& use Symbol; \& $fh = gensym; \& tie *$fh, "APR::Request::Brigade", $bb; \& print while <$fh>; .Ve .SS READ .IX Subsection "READ" .Vb 3 \& $bb\->READ($contents) \& $bb\->READ($contents, $length) \& $bb\->READ($contents, $length, $offset) .Ve .PP Reads data from the brigade \f(CW$bb\fR into \f(CW$contents\fR. When omitted \&\f(CW$length\fR defaults to \f(CW\-1\fR, which reads the first bucket into \f(CW$contents\fR. A positive \f(CW$length\fR will read in \f(CW$length\fR bytes, or the remainder of the brigade, whichever is greater. \f(CW$offset\fR represents the index in \f(CW$context\fR to read the new data. .SS READLINE .IX Subsection "READLINE" .Vb 1 \& $bb\->READLINE() .Ve .PP Returns the first line of data from the bride. Lines are terminated by linefeeds (the '\e012' character), but we may eventually use \f(CW$/\fR instead. .SH METHODS .IX Header "METHODS" APR::Request::Brigade::IO .SS read .IX Subsection "read" OO interface to APR::Request::Brigade::READ. .SS readline .IX Subsection "readline" OO interface to APR::Request::Brigade::READLINE. .SH "SEE ALSO" .IX Header "SEE ALSO" APR::Request, APR::Table, APR::Brigade. .SH COPYRIGHT .IX Header "COPYRIGHT" .Vb 6 \& Licensed to the Apache Software Foundation (ASF) under one or more \& contributor license agreements. See the NOTICE file distributed with \& this work for additional information regarding copyright ownership. \& The ASF licenses this file to You under the Apache License, Version 2.0 \& (the "License"); you may not use this file except in compliance with \& the License. You may obtain a copy of the License at \& \& http://www.apache.org/licenses/LICENSE\-2.0 \& \& Unless required by applicable law or agreed to in writing, software \& distributed under the License is distributed on an "AS IS" BASIS, \& WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \& See the License for the specific language governing permissions and \& limitations under the License. .Ve