You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Torsten Foertsch <to...@gmx.net> on 2008/04/14 16:51:07 UTC

Handing over the POST input to a virtual included part?

Hi,

is it possible to hand over the POST input of a SSI document to a virtual 
included part of it?

I have an SSI document that contains

<!--#include virtual="/ptest/ptest.pl?$QUERY_STRING" -->

This way I can pass parameters that are passed in the URI to the subrequest. 
But how can that be done if the request method is POST? (There is only one 
such part that wants to read the input.)

Thanks,
Torsten

Re: Handing over the POST input to a virtual included part?

Posted by Perrin Harkins <pe...@elem.com>.
On Mon, Apr 14, 2008 at 1:22 PM, Torsten Foertsch
<to...@gmx.net> wrote:
>  Thanks, that is at least a starting point to think. But I don't know how large
>  the request body can become. So, I thought of something like read and cache
>  the request body in something like fixup of the main request and then insert
>  an input filter in the subrequest. The point is the subrequest goes through
>  mod_proxy to another server.

At that point it's so complex that I think the value of using SSI is
lost.  I'd replace SSI with a local handler (or output filter) that
does the POST to the other server the way you want it.

- Perrin

Re: Handing over the POST input to a virtual included part?

Posted by Torsten Foertsch <to...@gmx.net>.
On Mon 14 Apr 2008, Geoffrey Young wrote:
> > is it possible to hand over the POST input of a SSI document to a virtual
> > included part of it?
> >
> > I have an SSI document that contains
> >
> > <!--#include virtual="/ptest/ptest.pl?$QUERY_STRING" -->
> >
> > This way I can pass parameters that are passed in the URI to the
> > subrequest. But how can that be done if the request method is POST?
> > (There is only one such part that wants to read the input.)
>
> convert the POST to a GET?  there are docs on the site on how to do this.

Thanks, that is at least a starting point to think. But I don't know how large 
the request body can become. So, I thought of something like read and cache 
the request body in something like fixup of the main request and then insert 
an input filter in the subrequest. The point is the subrequest goes through 
mod_proxy to another server.

How do I insert an input filter in the filter chain of a subrequest? A 
subrequest is created with an output filter chain but nothing for input.

Torsten

--
Need professional mod_perl support?
Just ask me: torsten.foertsch@gmx.net

Re: Handing over the POST input to a virtual included part?

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Torsten Foertsch wrote:
> Hi,
> 
> is it possible to hand over the POST input of a SSI document to a virtual 
> included part of it?
> 
> I have an SSI document that contains
> 
> <!--#include virtual="/ptest/ptest.pl?$QUERY_STRING" -->
> 
> This way I can pass parameters that are passed in the URI to the subrequest. 
> But how can that be done if the request method is POST? (There is only one 
> such part that wants to read the input.)

convert the POST to a GET?  there are docs on the site on how to do this.

--Geoff

Re: Handing over the POST input to a virtual included part?

Posted by ad...@utoronto.ca.
I think that virtual includes are handled with Apache sub-requests, so  
you might be able to get it the post data through $r->prev.  Worth a  
shot anyway.

Adam


Quoting Torsten Foertsch <to...@gmx.net>:

> Hi,
>
> is it possible to hand over the POST input of a SSI document to a virtual
> included part of it?
>
> I have an SSI document that contains
>
> <!--#include virtual="/ptest/ptest.pl?$QUERY_STRING" -->
>
> This way I can pass parameters that are passed in the URI to the subrequest.
> But how can that be done if the request method is POST? (There is only one
> such part that wants to read the input.)
>
> Thanks,
> Torsten
>




Re: [users@httpd] Handing over the POST input to a virtual included part?

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, Apr 14, 2008 at 10:51 AM, Torsten Foertsch
<to...@gmx.net> wrote:
> Hi,
>
>  is it possible to hand over the POST input of a SSI document to a virtual
>  included part of it?
>
>  I have an SSI document that contains
>
>  <!--#include virtual="/ptest/ptest.pl?$QUERY_STRING" -->
>
>  This way I can pass parameters that are passed in the URI to the subrequest.
>  But how can that be done if the request method is POST? (There is only one
>  such part that wants to read the input.)

My understanding is that this is not possible in 2.2, but is possible
in the development version (trunk) using the KeptBodySize directive:
http://httpd.apache.org/docs/trunk/mod/mod_request.html

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org