我试图通过从Android应用程序向PHP服务器发布数据来将记录插入MySQL.我已经向AndroidManifest.xml添加了INTERNET权限
我明白了 javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
Android代码
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());
}
}
Run Code Online (Sandbox Code Playgroud)
有人可以帮忙吗?