我要Jsoup連接到一個網址,你可以在代碼Jsoup,連接或不
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();
}
}
};
}
的響應是發現:
[email protected]
這是否意味着連接正常? 我很開始在開發,抱歉。 謝謝回答
你需要在響應中看*。 –