-------- Original Message --------
From: "Philip M. Gollucci" <[EMAIL PROTECTED]>
To: Jonathan Vanasco <[EMAIL PROTECTED]>
Cc: mod_perl List <modperl@perl.apache.org>
Subject: Re:Newbie help with Apache2::Request configuration
Date: Sat Dec 31 2005 19:22:28
Jonathan Vanasco wrote:
On Dec 31, 2005, at 1:22 PM, Philip M. Gollucci wrote:
One does CGI compatible decoding the other doesn't.
fully knowing this sounds stupid, can i just ask what that means?
APR::Request provides 2 functions encode and decode that access
application/x-www-form-urlencoded data
which the Apache2::Cookie methods freeze and thaw call for you internally.
APR::Request::Cookie 's freeze/thaw are "no ops" per say... just data
in/out.
--snip--
Philip,
My apologies for being a dumbo, your forbearance is much appreciated!
You seem to recommend the APR:* interfaces, but then go on to show that
to use APR::Request::Param to handle uploads, we will have to code
wrapper code similar to that in Apache2::Upload each time, for ourselves?
I also didn't understand the difference between the two cookie classes,
except that there is an implication that the APR::Request::Cookie
classes do not call freeze/thaw automatically? Does this mean that I
have to call encode/decode on values when I create or access
APR::Request::Cookie cookies?
I tried to get the APR::Request interface working to do some
investigation, but whilst the Apache2::* works fine, I have not yet
figured out how to get the cookies out of the APR::Request class.
I can't even seem to get the APR::Request->new() to work.
[embarrassment!] Mmmm, maybe there isn't a new() method? Or maybe my
install is broken: Can't locate auto/APR/Request/new.al
The docs say:
use APR::Request;
$req = APR::Request::Custom->handle($pool,
"foo=arg1&bar=arg2",
"cookie=apache",
$parser, 1e6, $bb);
$param = $req->param("foo");
$cookie = $req->jar("cookie");
Why Custom? and this doesn't work for me because I don't have:
$pool, $parser, $bb.
Now, I can guess, that $pool might be $r->pool, or maybe $r->pool->new
or even APR::Pool->new(). The first literal looks like it might be
$r->args(), the second literal looks like maybe I have to work my way
manually through the request headers, pluck out the cookie-like lines
and feed them in here, but then $parser - what is that?
And so I give up, not having been able to instantiate an
$req = APR::Request::anything
Any code samples would help me, though at this stage, it seems to me
that the Apache2::Cookie is much easier to understand, create and use.
One other thing, none of the SEE ALSO links work :(
Sorry to be such a pain - but the APR::Request interface and docs have
defeated me!
Regards & thanks,
Jeff