Any examples on webmail login
Hi I am new here and new to httpclient 2.0. I am trying write a http client which will login to a webmail using username and password. After executing the postmethod executemethod I got a response page with mail login page and a error message please upgrade your browser to one of the following IE or netscape. Is there anything I left out. I am using httpclient 2.0 alpha 3 here is my code. PostMethod post = new PostMethod(url); post.setRequestBody(formInput); //forminput post.setRequestContentLength(EntityEnclosingMethod.CONTENT_LENGTH_AUTO); post.setRequestHeader(Content-type, text/xml; ISO-8859-1); HttpClient httpclient = new HttpClient(); HostConfiguration hostConfig = new HostConfiguration(); hostConfig.setHost(connection.getHost(),connection.getPort(),connection.getProtocol()); httpclient.executeMethod(hostConfig,post); Thanks in advance Vijay. _ Call US for just Rs. 5. http://www.msn.co.in/webtelephony/ Get a phone card - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Any examples on webmail login
Sounds like your webmail app is checking the User-Agent header and refusing you access. You might want to fake your User-Agent header to look like an appropriate browser. -- Ryan Hoegg ISIS Networks http://www.isisnetworks.net vijay kumar wrote: Hi I am new here and new to httpclient 2.0. I am trying write a http client which will login to a webmail using username and password. After executing the postmethod executemethod I got a response page with mail login page and a error message please upgrade your browser to one of the following IE or netscape. Is there anything I left out. I am using httpclient 2.0 alpha 3 here is my code. PostMethod post = new PostMethod(url); post.setRequestBody(formInput); //forminput post.setRequestContentLength(EntityEnclosingMethod.CONTENT_LENGTH_AUTO); post.setRequestHeader(Content-type, text/xml; ISO-8859-1); HttpClient httpclient = new HttpClient(); HostConfiguration hostConfig = new HostConfiguration(); hostConfig.setHost(connection.getHost(),connection.getPort(),connection.getProtocol()); httpclient.executeMethod(hostConfig,post); Thanks in advance Vijay. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]