hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <http-as...@dubioso.net>
Subject Re: Problem logging in using a form
Date Sat, 28 Jan 2006 21:49:04 GMT
Hi Jesper,

> I am trying to log in on the website www.nordnet.dk. The website has a
> login-form (with the redirected address
> https://www.nordnet.se/tux/lang/login/login.pl)

That is not a redirect address. It is a target address for the form data.

> PostMethod pm = new PostMethod("http://www.nordnet.dk/");

Wrong.

> - which returns a "Method failed: HTTP/1.1 405 Method Not Allowed"-error.

Because you are not allowed to use POST on the URL of the main page.

> A little simplified I skip the website-address and access the
> https-login-address directly:

That is not simplified, it is simply correct.

> - and this works fine.
> 
> Why doesn't the first piece of code work?

Because you were sending the data to the main page instead of the
login script. The purpose of the main page is (among others) to
present a login form, not to interpret the data entered there.

hope that helps,
  Roland

---------------------------------------------------------------------
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