commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@bluewin.ch>
Subject Re: HttpClient: submit via input of type="image"
Date Sat, 11 Sep 2004 10:30:22 GMT
On Sat, 2004-09-11 at 10:39, Stephen Charles Huey wrote:
> I heartily agree.  I've been using HttpClient off and on this past year
> and have fortunately been able to use it quite effectively, and I know
> to check for Javascript that sets necessary hidden variables as the form
> is being submitted, etc.  I convinced myself that I was dealing with a
> new problem that defied all the tiny bit of knowledge I have on web
> standards on HTTP requests, but I found out it has to do with redirects
> and cookies instead.  
> 
> There's no way to set it to automatically follow redirects and so avoid
> the following message, is there?  Here it is:
> -------
> Sep 11, 2004 3:28:03 AM org.apache.commons.httpclient.HttpMethodBase
> processRedirectResponse
> 
> INFO: Redirect requested but followRedirects is disabled
> -------
> 

Stephen,

HttpClient 2.0 as useful as it can be unfortunately has a few design
limitations. It cannot handle cross site redirects (fixed in the 3.0
branch) and it cannot handle POST to GET redirects (this one will have
to wait until 4.0 as it requires a complete redesign of HttpClient
internals)


> Also, in the case of an error saying "Cookie rejected" due to an
> "Illegal path attribute", can we get it to accept it anyway?  Do we have
> to write our own subclass like what is mentioned here:

With the new (unstable) version of HttpClient (3.0-alpha1 or CVS HEAD)
one can plug in a custom cookie policy. For the stable version (2.0.1)
there's no way around subclassing 

Hope this clarifies things a little

Oleg


> 
> http://www.mail-archive.com/commons-httpclient-dev@jakarta.apache.org/msg06800.html
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ----- Original message -----
> From: "Oleg Kalnichevski" <olegk@bluewin.ch>
> To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
> Date: Sat, 11 Sep 2004 01:03:29 +0200
> Subject: Re: HttpClient:  submit via input of type="image"
> 
> Stephen,
> 
> When it comes to computers, things rarely happen by Lord Almighty's
> will. Just carefully examine the page source in the browser. There must
> be a FORM in the HTML source that most likely gets triggered by a
> javascript event. Once you know what action needs to be executed and
> what parameters are expected, it should be pretty trivial to implement
> the same using HttpClient
> 
> Hope this helps a little
> 
> Oleg
> 
> 
> On Fri, 2004-09-10 at 23:38, Stephen Charles Huey wrote:
> > Hey, I'm a major aficionado of HttpClient, but I'm stumped.  How do you
> > submit a form that can't really be submitted without either hitting the
> > Enter key while in an input of type="text" or clicking on an input of
> > type="image"?  In other words, say you have a JSX page where there are
> > event handlers on the server checking to see whether the Enter key was
> > pressed or an image was clicked (there's no basic submit button).  Is it
> > possible to use HttpClient or write something to work with it that will
> > send a request up to the server and trick the server into thinking that
> > one of these events occurred in the web browser?  Or is this just too
> > hairy for a lowly intermediate level coder like myself?  :)  
> > 
> > I like these cool form controls, but I guess they can be a pain
> > sometimes.  
> > 
> > Thanks,
> > Stephen
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


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


Mime
View raw message