Loopj AsynHttpClient
ASP.NET
我正在尝试连接到 ASP.NET WebApp。
OnSuccess 回调,我想读取网页并从网页中获取文本和数据。我怎样才能得到它,或者我怎样才能将它解析为 JSON 或 XML?我通过将参数发布到登录页面成功连接到该站点。现在我想阅读重定向的网页。以及如何保存 cookie 或缓存,以便在我运行 Android APP 时自动登录。
client.get("https://uogis.uog.edu.pk/LandingPage.aspx", new AsyncHttpResponseHandler(){
@Override
public void onFailure(int arg0, Header[] arg1,
byte[] arg2, Throwable arg3) {
// TODO Auto-generated method stub
}
@Override
public void onSuccess(int arg0, Header[] arg1,
byte[] arg2) {
// TODO Auto-generated method stub
mTextView.setText("In Landing Page now");
}
@Override
public void onFinish() {
params.put("TextBox1","Home");
client.get("https://uogis.uog.edu.pk/ControlPanel.aspx",new AsyncHttpResponseHandler(){
@Override
public void onFailure(int arg0,
Header[] arg1, byte[] arg2,
Throwable arg3) {
// TODO Auto-generated method stub
}
@Override
public void onSuccess(int arg0,
Header[] arg1, byte[] arg2) {
// TODO Auto-generated method stub
mTextView.setText("In Control Panel\n"+ "ResponseCode "+arg0+ "\n" );
}});
}
});