perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Schindl <tomAtLi...@gmx.at>
Subject Re: Apache Request
Date Fri, 05 Aug 2005 07:38:28 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Javier Alonso Sánchez schrieb:
> In according to the documentation:
> 
> "The Apache2::Request module provides methods for parsing GET and POST
> parameters encoded with either application/x-www-form-urlencoded or
> multipart/form-data."
> 
> Does only work with these two body types?
> Is there another way to get the body content and the headers at the same time?
> 
> Thanks
> 
> 

I don't know of any other body types at least a browser can send?

To get header information you use Apache::RequestRec:
http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_headers_in_

To get body content:
http://perl.apache.org/docs/2.0/api/Apache2/RequestIO.html#C_read_
http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_args_
Although parsing body content should be left to Apache2::Request in
normal circumstances. Using this method has the draw back that no other
handler later in the chain can read the content any more because it is
consumed by you.


If you need your own body parsing the better idea would be to write an
InputFilter http://perl.apache.org/docs/2.0/user/handlers/filters.html
to parse the content this is the same way Apache2::Request does it ;-)

Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC8xd0kVPeOFLgZFIRAonPAJ9dzLZQK5iMG/H0jk3zcFWz65M3wgCfSZ+5
oEsLCQdM2WM6xEAEUSHITRk=
=896r
-----END PGP SIGNATURE-----

Mime
View raw message