I need to implement the following task - login into a site (e.g. http://myexample.com) using java. I chose HttpURLConnection. I need to simulate POST request, user name and password are provided.
When I use browser login is successfull, but the code below rises an Exception (java.io.IOException: Server returned HTTP response code: 408 for URL). That means Request timeout. Why? How to avoid it?
BTW, in browser login is successfull, I see the welcome page. But Firebug demonstrates response code 302.