httpclient 模拟登录邮箱 登录邮箱
private static String USERNAME = "111111";
private static String PASSWORD = "222222";
private static String LOGINURL = "https://mail.qq.com";
public static void main(String[] args)
{
HttpClient httpClient = new HttpClient();
PostMethod authpost = new PostMethod(LOGINURL);
NameValuePair user = new NameValuePair("user",USERNAME);
NameValuePair pwd = new NameValuePair("password",PASSWORD);
NameValuePair username = new NameValuePair("username",USERNAME + "@qq.com");
authpost.setRequestBody(new NameValuePair[]{user,pwd,username});
int status = httpClient.executeMethod(authpost);
System.out.println(authpost.getResponseBodyAsString());
System.out.println(status);
为什么登录不上去,是因为没有设置登录页面参数吗?