The link asks to change POST to GET. However, there is a limit on the length of the URL so the POST data may be truncated and the redirect action may not work properly.
Also, make sure to escapeURL() in the URL (which will also add extra chars in the URL). Peter Bi ----- Original Message ----- From: "Kirk Bowe" <[EMAIL PROTECTED]> To: "Ken Y. Clark" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, June 24, 2002 8:50 AM Subject: Re: Preserving POST data on external redirect? > > Hi, yes that's one of the pages that I've been looking at, and the code is > almost identical (I've tried M_GET / GET as well). Still nothing > happening for me :-) > > Cheers > > Kirk. > > > > On Mon, 24 Jun 2002, Ken Y. Clark wrote: > > > On Mon, 24 Jun 2002, Kirk Bowe wrote: > > > > > Date: Mon, 24 Jun 2002 16:22:42 +0100 (BST) > > > From: Kirk Bowe <[EMAIL PROTECTED]> > > > To: [EMAIL PROTECTED] > > > Subject: Preserving POST data on external redirect? > > > > > > > > > > > > Hi all, my content handler does some work with POSTed data, and at the > > > end > > > wants to redirect to a totally unrelated server, preserving the POST data > > > that the client originally sent, so that the unrelated server can do its > > > own further processing with its own mod_perl, cgi, or whatever. > > > > > > I can't get it to work, as I think I'm getting confused by some > > > pre-Apache::Request hints that I've seen for this. This is the mess I've > > > got so far (condensed): > > > > > > sub handler > > > { > > > my $r = Apache::Request->new(shift); > > > > > > ... some calls to other subs here to do work ... > > > > > > $r->method("POST"); > > > $r->method_number(M_POST); > > > $r->headers_in->unset("Content-length"); > > > $r->args($content); > > > $r->header_out('Location' => "http://j.random.server.com/foo.cgi"); > > > $r->status(REDIRECT); > > > $r->send_http_header; > > > > > > return REDIRECT; > > > } > > > > > > It redirects, but doesn't pass the POST data. I thought it may have been > > > due to the original post data being deleted because I use it, so I tried > > > using Request->instance instead of Request->new, but that made no > > > difference either. Is it actually possible to do it if I'm using the > > > Request object? > > > > > > Cheers > > > > I think this is what you want: > > > > http://theoryx5.uwinnipeg.ca/cgi-bin/guide-filter?page=snippets/Redirect_a_P OST_Request_Forward.html;query=GET%20POST;match=and;where=all;stem=no > > > > ky > > > >