当我添加授权标头时,android 会引发 filenotfound 异常。如果我删除
con.setRequestProperty ("Authorization", basicAuth);
一切都很好?
con = (HttpsURLConnection)url.openConnection();
String userpass = userNameEditText.getText() + ":" + passwordEditText.getText();
String basicAuth = "Basic " + Base64.encodeToString(userpass.getBytes(), Base64.NO_WRAP);
con.setRequestProperty ("Authorization", basicAuth);