Hello Magnus,
you can always obtain the location of the redirect in
your application and query the page with a new method.
Preferably a GET method in that case.
The thing with automatic redirection of POST requests
(as POST requests) is that information in the request
may be sent to a place of which the user is unaware.
Redirecting the POST as a GET is no big thing, since
GET is not supposed to contain sensitive data. But
HTTP Client currently cannot change the type of the
request, so it doesn't handle this case automatically.
In your example, the data in the POST request is
evaluated immediately and does not need to be
re-sent to retrieve the results you obtain. So it is
OK to follow the redirect with a GET instead of a
POST request.
regards,
Roland
"Magnus Karlsson" <[EMAIL PROTECTED]>
27.10.2003 09:03
Please respond to "Commons HttpClient Project"
To: <[EMAIL PROTECTED]>
cc:
Subject: Force redirect in PostMethod
Hello,
First, thanks for the very helpful HttpClient that you have developed.
A question around the PostMethod class; the javadoc tells me that
according to some RFC it should not be possible to "automatically" follow
a redirect when I send posted data to a certain page.
However, I need to do just that, send data to an URL through post which is
redirecting me to a page with results from a query.
How do I handle this? Can I in some way force the PostMethod to allow me
to be redirected?
Best regards,
Magnus