You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Kip Cranford <kc...@advance-inc.com> on 2000/04/27 17:32:20 UTC

Re: how to rewrite to a POST

On: Thu, 27 Apr 2000 09:06:24 EDT "Ken Y. Clark" wrote:

>On Wed, 26 Apr 2000, David Hajoglou wrote:
>
>> so, is it possible to take a GET request and rewrite the uri into a POST
>> request and if so how?
>
>i'm not sure if that's really necessary.  you could just put the GET args
>into $r->pnotes, perhaps like so:
>
[ snip ]

This approach works, or you could use something like Apache::RequestNotes.
However, you still need to deal with file uploads potentially, which I don't
believe the RequestNotes does.

In my situation, file uploads are important, as is authentication.  I check
authentication credentials on every request, and redirect to a login page
immediately when the check fails.  In this case, posted information (including
the file upload information) would be lost, which isn't good if the user uploaded
a big file.  I work around this by doing a simple client-side authentication
check (I use cookies to hold a username, so just check to see if it exists),
which launches a sub-window allowing the user to authenticate if their cookie
has expired.  Not the most elegant, but the best I could come up with right now.  

I also store all the request information in pnotes like RequestNotes.  However,
I also store a refrence to the file upload information (if any) along with
information on where the file contents are located.

If there are better solutions out there, I'm all ears!


--kip