hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gustavo Hexsel <ghex...@sagebrushcorp.com>
Subject RE: POST Form Session Expired
Date Fri, 09 Sep 2005 00:31:23 GMT
  I know there is some limitation about POST redirects, which seems to be
the case.  But you are in the right path.  Have you tried monitoring which
intermediate steps happen after authentication (using Mozilla's tool)?  You
should probably disable followsRedirect, see what comes back, and create
another POST step that mimicks that.   I could take a look, but you'll have
to send the relevant parts of the wire log (the headers that are comming
back just before the "java.lang.IllegalArgumentException: Entity enclosing
requests cannot be 
redirected without user intervention").

  []s Gus



-----Original Message-----
From: Jeremy Whitlock [mailto:jcscoobyrs@gmail.com]
Sent: September 8, 2005 5:26 PM
To: HttpClient User Discussion
Subject: Re: POST Form Session Expired


Gustavo,
I have already tried this before to get yet another error. But just to make 
sure I am doing what you are saying, here is my updated code:

http://www.rafb.net/paste/results/1g6i0M37.html

Upon running this, I get the following:

Sep 8, 2005 5:21:44 PM
org.apache.commons.httpclient.HttpMethodDirectorisRedirectNeeded
INFO: Redirect requested but followRedirects is disabled

I cannot do post.setFollowRedirects(true) because it then complains about:

java.lang.IllegalArgumentException: Entity enclosing requests cannot be 
redirected without user intervention
at 
org.apache.commons.httpclient.methods.EntityEnclosingMethod.setFollowRedirec
ts
(EntityEnclosingMethod.java:221)
at com.jwhitlock.http.client.HttpClientTutorial.main(HttpClientTutorial.java
:192)
Exception in thread "main" 

I've not found a working solution but I'm sure we can figure this out. Take 
care, Jeremy

On 9/8/05, Gustavo Hexsel <ghexsel@sagebrushcorp.com> wrote:
> 
> About the POST problem, can you post that part of the wire log?
> 
> 
> 
> -----Original Message-----
> From: Gustavo Hexsel [mailto:ghexsel@sagebrushcorp.com]
> Sent: September 8, 2005 4:53 PM
> To: 'HttpClient User Discussion'
> Subject: RE: POST Form Session Expired
> 
> 
> Cookies. Reuse the HttpClient instance throughout the whole operation.
> 
> -----Original Message-----
> From: Jeremy Whitlock [mailto:jcscoobyrs@gmail.com]
> Sent: September 8, 2005 4:48 PM
> To: HttpClient-User
> Subject: POST Form Session Expired
> 
> 
> Hey all,
> I am doing a GET on a login form, parsing the form for hidden input and 
> then
> 
> creating a POST with NameValuePair objects corresponding to the hidden 
> input
> 
> and the two form input fields. I seem to have a minor problem with my
> approach as I always get a "Session Expired" from the server I'm logging
> into. Can someone give me a pseudo flow of how this goes? Here is the
> current code:
> 
> http://www.rafb.net/paste/results/mnOMtY87.html
> 
> Can someone see what I'm doing wrong? I have tried a minor spin on this
> where instead of creating an HttpClient for each method I have a global 
> one
> but then I get a problem with the POST not being able to redirect. Thanks,
> Jeremy
> --
> He who listens well, speaks well.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
> 


-- 
He who listens well, speaks well.

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message