Re: reading post data.

[prev] [thread] [next] [Date index for 2005/04/23]

From: Stas Bekman
Subject: Re: reading post data.
Date: 21:00 on 23 Apr 2005
Michael Schout wrote:
> I am wondering what the best way is to read POST data under MP2.
> 
> In MP1, I was using $r->content for this.  In MP2, $r->content does not
> exist, so I used the version from an earlier copy of Apache::compat,
> which was using $r->get_client_block() instead.
> 
> Now, get_client_block() is apparently deprecated, and I am left with the
> choice of:
> 
> 1) using $r->read().  CGI.pm apparently does it this way.
> 2) Use APR::Brigade.  Apache2::compat from 2.0.0 RC5 does provides
> content() this way.
> 3) some other way that I do not know about :).
> 
> I am unclear what the advantages are for either approach.  The
> APR::Brigade docs do not really clarify this for me.
> 
> Does anyone know which of these methods is better and why?

Michael, as Jonathan has replied it's now the job of CGI.pm, APR::Request 
and other modules to provide this service. In the lack of it, you can use 
the following code:

http://svn.apache.org/viewcvs.cgi/perl/modperl/trunk/t/lib/TestCommon/Utils.pm?rev=160947&view=markup
(see the read_post sub in it, drop the debug code to not add the overhead)

        -- 
        __________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxx.xxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

reading post data.
Michael Schout 19:56 on 23 Apr 2005

Re: reading post data.
jonathan vanasco 20:16 on 23 Apr 2005

Re: reading post data.
Dermot Paikkos 07:49 on 26 Apr 2005

Re: reading post data.
Philip M. Gollucci 08:33 on 26 Apr 2005

Re: reading post data.
Stas Bekman 21:00 on 23 Apr 2005

Generated at 09:30 on 27 Apr 2005 by mariachi v0.52