xmlHttp.open('post', './UserServer', true);
xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttp.send("type=1&userId=" + userId);
//send()方法参数传错也会报405,比如少了 '=' 或者 '&' 或者 setRequestHeader("Content-type", "application/x-www-form-urlencoded")
Java web 使用 AJAX POST方法405报错
于 2021-12-20 00:54:07 首次发布
本文详细解析了使用XMLHttpRequest发送POST请求时常见的405错误原因,包括send方法参数错误的情况,例如缺少'='或'&'符号及未设置正确的Content-Type。

5067

被折叠的 条评论
为什么被折叠?



