what are the best APIs of java for Http web login? see my problem please.
my question is, what are the best APIs for http web login?
my problem is, i have developed an applet which connects to different websites and log me in, through https. i am using org.apache.commons.httpclient package and some other packages by apache, my code is working fine and i am successfull in the most websites, but in few i got problems, i want to dicuss it here and also i m sending my code and warnings i recieve.... here is my code.
HttpClient client = new HttpClient();
client.getState().setCredentials(
new AuthScope("http://www.cigna.com",443),
new UsernamePasswordCredentials( "adfafda", "dfdfdfdf" ) );
///////////////////////// First Request ///////////////////////////////////////
PostMethod req1 = new PostMethod("https://sso.corp.cigna.com/corp/sso/dlgprovider/forms/providerlogin.fcc?");
NameValuePair[] loginData = {
new NameValuePair("USERNAME", "avx"),
new NameValuePair("PASSWORD", "ssssss"),
new NameValuePair("TARGET", "https%3A%2F%2Fsso.corp.cigna.com%2Fcorp%2Fsso%2Fdlg%2Fprovider%2Fsecure%2Fcontroller%3Fcommand%3Dhomepage")
};
req1.setRequestBody();
try {
client.executeMethod(req1);
InputStream responseInputStream=req1.getResponseBodyAsStream();
BufferedReader rd = new BufferedReader(new InputStreamReader(responseInputStream));
String line;
StringBuffer response = new StringBuffer();
while ((line = rd.readLine()) != null) {
response.append(line);
}
rd.close();
File myFile = new File("D:/cignaResult1.html");
BufferedWriter fileOut = new BufferedWriter(new FileWriter(myFile));
fileOut.write(response.toString());
fileOut.close();
}
catch(HttpException he){ System.err.println("Exception:....."+he);}
catch(IOException ieo){ System.err.println("Exception:....."+ieo);}
catch(Exception e){System.err.println("Exception:....."+e);}
req1.releaseConnection();
***************************************
and i am getting these warning, that i did'nt seen in other weblogins.
WARNING: Cookie rejected: "$Version=0; FORMCRED=9z2ShgRx2pHuXYKdFvCSlVqskWULxxKu
M9qawtchAvg2A8K3CPz1kXWFX92wqerz3MQWFOa0KzuUd9Tjmn5WJ/obzk5UrdeKEWrbQBvg9fnAocmD
XHhgBF4D7iL/zZICggI0UMAVzgKzjNLpFPFYgQ==; $Path=/; $Domain=.cigna.com". Domain a
ttribute ".cigna.com" violates RFC 2109: host minus domain may not contain any dots
please tell me where i am wrong, and what should i do for this?

