platformurl = "http://127.0.0.1:7777/api/Payh5/getplatform"
var httpRequest1 = new XMLHttpRequest();
httpRequest1.open('get',platformurl,false);
httpRequest1.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
httpRequest1.send();
百思不得其解
确认是这个代码?看截图网址缺少了http://协议导致的,应该不是这个贴出代码。
get请求不需要设置Content-type,post才会需要。
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!