Egret社区

http请求为什么老是ioError

2020-7-17 18:22
1712
https://shguaji.linnsea.com/login/gateway/root/getWeixinServerList.action?code=033MsWyp04Obxl1nIbyp0x5Wyp0MsWyO&platform=android&clientVersion=1.63.1

上面这个请求一直抱ioError 只有真机调试的时候会出现 微信开发者工具没出现

            let request = new egret.HttpRequest();
            if (this._dealPost && typeof this._postData === 'object') {
                let postData = this._postData;
                let paramsList = [];
                for (let key in postData) {
                    paramsList.push(key + '=' + postData[key]);
                }
                this._postData = paramsList.join('&');
            }
            this._request = request;
            request.setRequestHeader("Content-Type", this._contentType || "text/plain;charset=UTF-8");
            request.addEventListener(egret.Event.COMPLETE, this.onComplete, this);
            request.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onError, this);
            request.open(this._url, this._method || egret.HttpMethod.GET);
            request.send(this._postData);


分享到 :
0 人收藏

2 个回复

倒序浏览
peytonli  初学乍练 | 2020-7-20 09:50:17
curl --location --request GET 'https://shguaji.linnsea.com/login/gateway/root/getWeixinServerList.action?code=033MsWyp04Obxl1nIbyp0x5Wyp0MsWyO&platform=android&clientVersion=1.63.1'
{"state":1,"data":{"gameUrl":"https://newsglogin.linnsea.com/login/gateway/root/weixinLogin.action","lastLoginServer":0,"myServerList":[],"allServerList":[],"allStatusList":[],"whiteUser":false,"userId":"033MsWyp04Obxl1nIbyp0x5Wyp0MsWyO","payEnv":null}}%

curl是可以获取得到的
siwenjie  登堂入室 | 2020-7-20 11:42:43
看看是不是跨域的问题,参考这篇文章,和你的错误一样http://www.fgreen.org/?p=937
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

peytonli

初学乍练

积分: 4 帖子: 3 精华: 0

小黑屋|京网文[2014]0791-191号|京ICP证150115号|Egret社区 ( 京ICP备14025619号 )

Powered by Discuz! X3.4 © 2001-2019 Comsenz Inc.

返回顶部