| <!-- HTML header for doxygen 1.9.1--> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| <meta name="generator" content="Doxygen 1.9.1"/> |
| <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| <title>libapreq2-2.17: APR::Request::Param</title> |
| <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="jquery.js"></script> |
| <script type="text/javascript" src="dynsections.js"></script> |
| <link href="customdoxygen.css" rel="stylesheet" type="text/css" /> |
| </head> |
| <body> |
| <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| <div id="titlearea"> |
| <table cellspacing="0" cellpadding="0" width="100%"> |
| <tbody> |
| <tr style="height: 56px;"> |
| <!-- |
| <td id="projectlogo"><img alt="Logo" src="feather.png"/></td> |
| --> |
| <!-- |
| <td id="projectalign" style="padding-left: 0.5em;"> |
| <div id="projectname">libapreq2 |
| < !--BEGIN PROJECT_NUMBER-- > <span id="projectnumber">2.17</span>< !--END PROJECT_NUMBER-- > |
| </div> |
| < !--BEGIN PROJECT_BRIEF-- ><div id="projectbrief"></div>< !--END PROJECT_BRIEF-- > |
| </td> |
| --> |
| <td> |
| <div id="page-header"> |
| <p class="menu"> |
| <a href="https://www.apache.org/">Apache Software Foundation</a> > |
| <a href="https://httpd.apache.org">HTTP Server Project</a> > |
| <a href="https://httpd.apache.org/apreq/">Request Library Subproject</a> |
| </p> |
| <p class="apache">Apache HTTP Server Request Library - 2.17</p> |
| <img alt="" src="feather.png" /> |
| </div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.9.1 --> |
| <script type="text/javascript" src="menudata.js"></script> |
| <script type="text/javascript" src="menu.js"></script> |
| <script type="text/javascript"> |
| /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| $(function() { |
| initMenu('',false,false,'search.php','Search'); |
| }); |
| /* @license-end */</script> |
| <div id="main-nav"></div> |
| </div><!-- top --> |
| <div class="header"> |
| <div class="headertitle"> |
| <div class="title">APR::Request::Param<div class="ingroups"><a class="el" href="group__apreq__lang.html">Language Bindings</a> » <a class="el" href="group__apreq__xs.html">Perl</a></div></div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| <div class="dynheader"> |
| Collaboration diagram for APR::Request::Param:</div> |
| <div class="dyncontent"> |
| <div class="center"><img src="group__apreq__xs__apr__request__param.png" border="0" usemap="#agroup____apreq____xs____apr____request____param" alt=""/></div> |
| <map name="agroup____apreq____xs____apr____request____param" id="agroup____apreq____xs____apr____request____param"> |
| <area shape="rect" title=" " alt="" coords="100,5,259,31"/> |
| <area shape="rect" href="group__apreq__xs.html" title="XS Modules." alt="" coords="5,5,52,31"/> |
| </map> |
| </div> |
| |
| |
| |
| |
| <ul id="index"> |
| <li><a href="#NAME">NAME</a></li> |
| <li><a href="#SYNOPSIS">SYNOPSIS</a></li> |
| <li><a href="#DESCRIPTION">DESCRIPTION</a></li> |
| <li><a href="#OVERLOADS">OVERLOADS</a> |
| <ul> |
| <li><a href="#">""</a></li> |
| </ul> |
| </li> |
| <li><a href="#METHODS">METHODS</a> |
| <ul> |
| <li><a href="#name">name</a></li> |
| <li><a href="#value">value</a></li> |
| <li><a href="#is_tainted">is_tainted</a></li> |
| <li><a href="#charset">charset</a></li> |
| <li><a href="#make">make</a></li> |
| <li><a href="#info">info</a></li> |
| <li><a href="#upload">upload</a></li> |
| <li><a href="#upload_filename">upload_filename</a></li> |
| <li><a href="#upload_link">upload_link</a></li> |
| <li><a href="#upload_slurp">upload_slurp</a></li> |
| <li><a href="#upload_size">upload_size</a></li> |
| <li><a href="#upload_type">upload_type</a></li> |
| <li><a href="#upload_tempname">upload_tempname</a></li> |
| <li><a href="#upload_io">upload_io</a></li> |
| <li><a href="#upload_fh">upload_fh</a></li> |
| </ul> |
| </li> |
| <li><a href="#METHODS1">METHODS</a> |
| <ul> |
| <li><a href="#new-TIEHANDLE">new, TIEHANDLE</a></li> |
| <li><a href="#READ">READ</a></li> |
| <li><a href="#READLINE">READLINE</a></li> |
| </ul> |
| </li> |
| <li><a href="#METHODS2">METHODS</a> |
| <ul> |
| <li><a href="#read">read</a></li> |
| <li><a href="#readline">readline</a></li> |
| </ul> |
| </li> |
| <li><a href="#SEE-ALSO">SEE ALSO</a></li> |
| <li><a href="#COPYRIGHT">COPYRIGHT</a></li> |
| </ul> |
| |
| <h1 id="NAME">NAME</h1> |
| |
| <p>APR::Request::Param - wrapper for libapreq2's param API.</p> |
| |
| <h1 id="SYNOPSIS">SYNOPSIS</h1> |
| |
| <pre><code>use APR::Request::Param; |
| |
| $arg1 = $req->args('alpha'); |
| $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('beta'); |
| $param->upload_slurp(my $content);</code></pre> |
| |
| <h1 id="DESCRIPTION">DESCRIPTION</h1> |
| |
| <p>The <code>APR::Request::Param</code> module provides base methods for interfacing with libapreq2's param API. It also provides a few utility functions and constants.</p> |
| |
| <p>This manpage documents version 2.18 of the APR::Request::Param, APR::Request::Brigade, and APR::Request::Brigade::IO packages.</p> |
| |
| <h1 id="OVERLOADS">OVERLOADS</h1> |
| |
| <p>APR::Request::Param</p> |
| |
| <h2 id="">""</h2> |
| |
| <pre><code>"$param"</code></pre> |
| |
| <p>The double-quote interpolation operator maps to <code>APR::Request::Param::value()</code>.</p> |
| |
| <h1 id="METHODS">METHODS</h1> |
| |
| <p>APR::Request::Param</p> |
| |
| <h2 id="name">name</h2> |
| |
| <pre><code>$param->name()</code></pre> |
| |
| <p>Returns the param's name. This attribute cannot be modified.</p> |
| |
| <h2 id="value">value</h2> |
| |
| <pre><code>$param->value()</code></pre> |
| |
| <p>Returns the param's value. This attribute cannot be modified.</p> |
| |
| <h2 id="is_tainted">is_tainted</h2> |
| |
| <pre><code>$param->is_tainted() |
| $param->is_tainted($set)</code></pre> |
| |
| <p>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 name() and/or value().</p> |
| |
| <pre><code>$tainted = $param->is_tainted; |
| $param->is_tainted(0); |
| ok $param->is_tainted == 0;</code></pre> |
| |
| <h2 id="charset">charset</h2> |
| |
| <pre><code>$param->charset() |
| $param->charset($set)</code></pre> |
| |
| <p>Get/set the param's internal charset. The charset is a number between 0 and 255; the current recognized values are</p> |
| |
| <dl> |
| |
| <dt id="APREQ_CHARSET_ASCII-7-bit-us-ascii">0 APREQ_CHARSET_ASCII (7-bit us-ascii)</dt> |
| <dd> |
| |
| </dd> |
| <dt id="APREQ_CHARSET_LATIN1-8-bit-iso-8859-1">1 APREQ_CHARSET_LATIN1 (8-bit iso-8859-1)</dt> |
| <dd> |
| |
| </dd> |
| <dt id="APREQ_CHARSET_CP1252-8-bit-Windows-1252">2 APREQ_CHARSET_CP1252 (8-bit Windows-1252)</dt> |
| <dd> |
| |
| </dd> |
| <dt id="APREQ_CHARSET_UTF8-utf8-encoded-Unicode">8 APREQ_CHARSET_UTF8 (utf8 encoded Unicode)</dt> |
| <dd> |
| |
| </dd> |
| </dl> |
| |
| <p>See <a>is_tainted</a> above for info about how APREQ_CHARSET_UTF8 relates to perl's UTF-8 flag.</p> |
| |
| <pre><code>$charset = $param->charset; |
| $param->charset(2); |
| ok $param->charset == 2;</code></pre> |
| |
| <h2 id="make">make</h2> |
| |
| <pre><code>APR::Request::Param->make($pool, $name, $value)</code></pre> |
| |
| <p>Fast XS param constructor.</p> |
| |
| <h2 id="info">info</h2> |
| |
| <pre><code>$param->info() |
| $param->info($set)</code></pre> |
| |
| <p>Get/set the APR::Table headers for this param.</p> |
| |
| <h2 id="upload">upload</h2> |
| |
| <pre><code>$param->upload() |
| $param->upload($set)</code></pre> |
| |
| <p>Get/set the APR::Brigade file-upload content for this param.</p> |
| |
| <h2 id="upload_filename">upload_filename</h2> |
| |
| <pre><code>$param->upload_filename()</code></pre> |
| |
| <p>Returns the client-side filename associated with this param.</p> |
| |
| <h2 id="upload_link">upload_link</h2> |
| |
| <pre><code>$param->upload_link($path)</code></pre> |
| |
| <p>Links the file-upload content with the local file named <code>$path</code>. Creates a hard-link if the spoolfile's (see <a>upload_tempname</a>) temporary directory is on the same device as <code>$path</code>; otherwise this writes a copy.</p> |
| |
| <h2 id="upload_slurp">upload_slurp</h2> |
| |
| <pre><code>$param->upload_slurp($data)</code></pre> |
| |
| <p>Reads the entire file-upload content into <code>$data</code>.</p> |
| |
| <h2 id="upload_size">upload_size</h2> |
| |
| <pre><code>$param->upload_size()</code></pre> |
| |
| <p>Returns the size of the param's file-upload content.</p> |
| |
| <h2 id="upload_type">upload_type</h2> |
| |
| <pre><code>$param->upload_type()</code></pre> |
| |
| <p>Returns the MIME-type of the param's file-upload content.</p> |
| |
| <h2 id="upload_tempname">upload_tempname</h2> |
| |
| <pre><code>$param->upload_tempname()</code></pre> |
| |
| <p>Returns the name of the local spoolfile for this param.</p> |
| |
| <h2 id="upload_io">upload_io</h2> |
| |
| <pre><code>$param->upload_io()</code></pre> |
| |
| <p>Returns an <a>APR::Request::Brigade::IO</a> object, which can be treated as a non-seekable IO stream.</p> |
| |
| <h2 id="upload_fh">upload_fh</h2> |
| |
| <pre><code>$param->upload_fh()</code></pre> |
| |
| <p>Returns a seekable filehandle representing the file-upload content.</p> |
| |
| <h1 id="METHODS1">METHODS</h1> |
| |
| <p>APR::Request::Brigade</p> |
| |
| <p>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 <code>seek</code> on handles tied to this class. Such handles have semantics similar to that of a read-only socket.</p> |
| |
| <h2 id="new-TIEHANDLE">new, TIEHANDLE</h2> |
| |
| <pre><code>APR::Request::Brigade->TIEHANDLE($bb)</code></pre> |
| |
| <p>Creates a copy of the bucket brigade represented by $bb, and blesses that copy into the APR::Request::Brigade class. This provides syntactic sugar for using perl's builtin <code>read</code>, <code>readline</code>, and <code><></code> operations on handles tied to this package:</p> |
| |
| <pre><code>use Symbol; |
| $fh = gensym; |
| tie *$fh, "APR::Request::Brigade", $bb; |
| print while <$fh>;</code></pre> |
| |
| <h2 id="READ">READ</h2> |
| |
| <pre><code>$bb->READ($contents) |
| $bb->READ($contents, $length) |
| $bb->READ($contents, $length, $offset)</code></pre> |
| |
| <p>Reads data from the brigade $bb into $contents. When omitted $length defaults to <code>-1</code>, which reads the first bucket into $contents. A positive $length will read in $length bytes, or the remainder of the brigade, whichever is greater. $offset represents the index in $context to read the new data.</p> |
| |
| <h2 id="READLINE">READLINE</h2> |
| |
| <pre><code>$bb->READLINE()</code></pre> |
| |
| <p>Returns the first line of data from the bride. Lines are terminated by linefeeds (the '\012' character), but we may eventually use <code>$/</code> instead.</p> |
| |
| <h1 id="METHODS2">METHODS</h1> |
| |
| <p>APR::Request::Brigade::IO</p> |
| |
| <h2 id="read">read</h2> |
| |
| <p>OO interface to APR::Request::Brigade::READ.</p> |
| |
| <h2 id="readline">readline</h2> |
| |
| <p>OO interface to APR::Request::Brigade::READLINE.</p> |
| |
| <h1 id="SEE-ALSO">SEE ALSO</h1> |
| |
| <p><a>APR::Request</a>, <a>APR::Table</a>, <a>APR::Brigade</a>.</p> |
| |
| <h1 id="COPYRIGHT">COPYRIGHT</h1> |
| |
| <pre><code>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.</code></pre> |
| |
| |
| </div><!-- contents --> |
| <!-- HTML footer for doxygen 1.9.1--> |
| <!-- start footer part --> |
| <hr class="footer"/> |
| <table class="footer"> |
| <td> |
| <address class="footer_left"><small> |
| Copyright © 2003-2022 <a href="https://www.apache.org">The Apache Software Foundation</a>.<br/> |
| See <a href="apreq_license.html">LICENSE</a>. |
| </small></address> |
| </td> |
| <td> |
| <address class="footer"><small> |
| Generated on Sat Sep 3 2022 17:23:06 for libapreq2 by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 |
| </small></address> |
| </td> |
| </table> |
| </body> |
| </html> |