我正在尝试通过将数据从 Android 应用程序发布到 PHP 服务器来将记录插入 MySQL。我已将 INTERNET 权限添加到 AndroidManifest.xml
我明白了javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
安卓代码
private void senddata(ArrayList<NameValuePair> data)
{
try
{
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("https://10.0.2.2/insert222.php");
httppost.setEntity(new UrlEncodedFormEntity(data));
HttpResponse response = httpclient.execute(httppost);
}
catch (Exception e) {
// TODO: handle exception
Log.e("log_tag", "Error: "+e.toString());
}
}
任何人都可以帮忙吗?