https的post报错

浏览:639 发布日期:2020/05/30 分类:求助交流 关键字: js https
服务器已经部署好了https,能正常访问网站,同样的thinkphp后端代码,get请求能正常访问,但是提交post请求的ajax报错,如图所示,前端调试控制台提示:Failed to load resource: net::ERR_CONNECTION_RESET,net::ERR_CONNECTION_CLOSED,
js代码如下:
var xhttp = new xmlHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("email_hint").innerHTML =
this.responseText;
}
};
xhttp.open("POST", "sendEmailCode", true);
xhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xhttp.send('email='+$("#security_email").val());

最佳答案
评论( 相关
后面还有条评论,点击查看>>