我必须将 Jsoup 连接到一个 url,你可以在代码中找到它
public class MainActivity extends Activity {
private static final String LOG_TAG = "debugger";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
downloadThread.start();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
Thread downloadThread = new Thread() {
public void run() {
try {
Log.i(LOG_TAG,"Beginning");
Response res = Jsoup
.connect("https://cas.scolastance.com/cas-auvergne/login?service=http://clg-cosne-d-allier.entauvergne.fr/sco/Modules/Accueil/Accueil.aspx")
.data("username", "myuser", "password", "mypass")
.data("submit", "SE CONNECTER")
.method(Method.POST)
.execute();
Log.i(LOG_TAG,res.toString());
} catch (IOException e) {
e.printStackTrace();
}
}
};
}
回应是:
org.jsoup.helper.httpConnection$response@41577a10
这是否意味着连接正常?我是开发的初学者,对不起。谢谢回答