Once you change the method to GET and put the content in with $r->args();,
it becomes GET data from the query_string.   All the POST data is lost
when you call content(), so you can no longer read it as POST data with
$r->content() again.

------------
Brian Nilsen
[EMAIL PROTECTED]

On Wed, 29 Aug 2001, Rasoul Hajikhani wrote:

> Robert Landrum wrote:
> > 
> > At 9:36 AM -0700 8/29/01, Rasoul Hajikhani wrote:
> > >Hello,
> > >I already have asked this question and got an answer for it, so please
> > >accept my forwarded apologies. However, I was trying something else and
> > >got stuck. I know in order to pass around query string, or form data,
> > >pnotes may be used. However, I am trying something else and it does not
> > >seem to work!
> > >
> > >       $r = Apache::Request->new($r);
> > >       # check for some condition
> > >       if ($condition)
> > >       {
> > >               my $previous_uri        = $r->param('previous_uri');
> > >
> > >                my $content             = $r->param();
> > >
> > >                $r->method_number(M_GET);
> > >                $r->method('GET');
> > >
> > >                $r->headers_in->unset("Content-length");
> > >
> > >                $r->args($content);
> > >
> > >                $r->internal_redirect("$previous_uri");
> > >       }
> > 
> > So your goal is to turn a post request into a get request using an
> > internal redirect.
> > 
> > >However, in my called handler, no Post data can be read. Can any one
> > >tell me why is that?
> > >Any comments welcomed...
> > 
> > param does not work like args, and $content in this example will
> > return the number of param keys (IIRC).
> > 
> > I think you want
> > 
> > my $content = join('&',map{$_."=".$r->param($_)}($r->param));
> > 
> > Which should solve your problems (I think).
> 
> I am affraid it did not work. I have no problem reading the data in the
> current handler, but right after redirect, which is also required to
> read the data, I loose all the POSTED data.
> > 
> > Rob
> > 
> > --
> > "A good magician never reveals his secret; the unbelievable trick
> > becomes simple and obvious once it is explained. So too with UNIX."
> 

Reply via email to