我正在尝试将数据发布到url
并返回json
。这与http
一起工作正常,但当我将我的网站http
切换为https
代码时,显示错误错误。
protected String doInBackground(String... urls) {
try {
ServiceHandler sh = new ServiceHandler();
String nextUrl = "https://megsta.com/h/gettokenapi.php";
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("email", emailstr));
params.add(new BasicNameValuePair("pass", passstr));
String jsonStr = sh.makeServiceCall(nextUrl, ServiceHandler.POST, params);
Log.d("Response: ", "> " + jsonStr);
if (jsonStr != null) {
status = jsonStr;
} else {
Log.e("ServiceHandler", "Couldn't get any data from the url");
}
} catch (Exception e) {
pDialog.dismiss();
Log.d("Background Task", e.toString());
}
return status;
}