You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Javier Alonso Sánchez <ja...@gmail.com> on 2005/08/05 01:24:34 UTC

Apache Request

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

Re: Apache Request

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Tom Schindl wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Javier Alonso Sánchez schrieb:
> 
>>In according to the documentation:
> 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 ;-)
You might look at
Apache2::DebugFilter to look at the buckets of the bridgades being sent.

Re: Apache Request

Posted by Tom Schindl <to...@gmx.at>.
-----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-----