On 01/12/2008, Vishwas Babu <[EMAIL PROTECTED]> wrote:
> Hi sebb,
>
> Thanks for the reply. I am facing the same issue after manually handling the
> redirect on the second post.
You have not sent the POST parameter.
> Also,I am getting the following message in the log before following the
> redirect on the second post.
>
> // Log extract
>
> 6469 [main] DEBUG org.apache.http.impl.conn.SingleClientConnManager - Get
>
> connection for route HttpRoute[{s}->https://sw.wilytech.com]
>
>
> 6469 [main] WARN org.apache.http.impl.conn.SingleClientConnManager - Invalid
> use of SingleClientConnManager: connection still allocated.
>
> Make sure to release the connection before allocating another one.
See below.
> 6469 [main] DEBUG org.apache.http.impl.conn.DefaultClientConnection -
> Connection shut down
> Thanks,
>
> Vishwas
>
> PS: I have attached the modified lines of code and the log.
>
>
> //Code change for the second post
>
> HttpClientParams.*setRedirecting*(httpParams,
> *false*);
>
> client.setParams(httpParams);
>
> HttpResponse httpResponse = client.execute(httpost);
>
> Header locationHeader = httpResponse.getHeaders("location")[0];
You need to finish the response. Try using the ResponseHandler as you
did in the other requests.
> // Manually follow the redirect and do a post to the location URL
>
> HttpPost httpost1 =
> *new* HttpPost(locationHeader.getValue());
>
> httpost1.setHeader(
> "Referer",
>
> "https://sw.wilytech.com/ProductRegistration/registration;?path=0") ;
>
> initializeConnectionHeaders(httpost1);
>
Where is the parameter set?
> firstResponse = client.execute(httpost1, responseHandler);
>
>
>
If you have any further issues, I suggest you compare what a browser
sends with what your program is sending. Some browsers have addons
that allow you to record the HTTP(S) traffic.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]