how to login to a site like this?

前端 未结 1 461
陌清茗
陌清茗 2021-02-04 22:40

I want to create an android app to login to my internet provider website and then read my 3g data comsumption.

(It\'s a https website: https://www.simyo.es/simyo/portal/

1条回答
  •  旧巷少年郎
    2021-02-04 22:55

    Before

    HttpGet request = new HttpGet("https://www.simyo.es/simyo/portal/customer/action/my-panel");
    

    Do a

    HttpPost request = new HttpPost("https://www.simyo.es/simyo/portal/j_security_check");
    List nameValuePairs = new ArrayList(2);
    nameValuePairs.add(new BasicNameValuePair("j_username", "PUT_USERNAME_HERE"));
    nameValuePairs.add(new BasicNameValuePair("j_password", "PUT_PASSWORD_HERE"));
    request.setEntity(new UrlEncodedFormEntity(nameValuePairs));
    client.execute(request);
    

    0 讨论(0)
提交回复
热议问题