• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 48 项符合查询结果, 库内数据总量为 30,903 项。 (搜索耗时: 0.0034 秒)

1. 手机调试时http请求错误,返回Request failed Status:0 [ 100%]

...new Laya.HttpRequest(); hr.http.timeout = 5000; hr.on(Laya.Event.PROGRESS, this, this.onHttpRequestProgress); hr.once(Laya.Event.COMPLETE, this, (response)=>{ UIFactory.closeWaitBar(); this.onHttpRequestComplete(response); if(handleOk){ handleOk(response); } }); hr.once(Laya.Event.ERROR, this, (e...

来源: Laya_社区 发布时间: 20190308

2. 网络请求添加headers后 post数据错误 [ 97%]

...加headers则正常  示例代码  var headers = [ 'C-Sign', sign ]; // this.caller = caller; this.callbackHandler = callback; // this.errcallback = errcallback; //this.http.once(Laya.Event.PROGRESS, this, this.onHttpRequestProgress); this.http.once(Laya.Event.COMPLETE, this, this.onHttpRequestCom...

来源: Laya_社区 发布时间: 20180916

3. httpRequest send返回Request failed Status:0 [ 97%]

... = "http://thirdqq.qlogo.cn/g%3Fb% ... 3B%3B xhr.once(Laya.Event.COMPLETE, this, this.completeHandler, [url, 1]); xhr.once(Laya.Event.ERROR, this, this.errorHandler); xhr.send(url, "", "get", "arraybuffer"); } } GameMain.prototype.completeHandler = function (URL, id, data) { // private completeHandl...

来源: Laya_社区 发布时间: 20180629

4. 最新版本IDE,如何获取http返回的json数据 [ 93%]

...; xhr.http.timeout = 10000;//设置超时时间; xhr.once(Event.COMPLETE,this,completeHandler); xhr.once(Event.ERROR,this,errorHandler); xhr.once(Event.PROGRESS,this,processHandler);  var sendData = {account:"aaa",password:"bbb"} xhr.send("http://xxx/login", JSON.stringify(sendData), "post", "jso...

来源: Laya_社区 发布时间: 20180824

5. Native下http请求,Error事件中的error对象错误码全都是404 [ 90%]

...西在原生不应该会有这个问题才是的 比如说这个代码: this.hr.once(Event.COMPLETE, this, onHrCompleteHandler); this.hr.once(Event.ERROR , this ,onHrErrorHandler); this.hr.send($url, $data, $method, $responseType, $headers); private function onHrCompleteHandler():void { if(this.co...

来源: Laya_社区 发布时间: 20180528

6. HTTP以POST发送Byte字节流,服务器无法解析 [ 90%]

...e.log("starConnection"); conn=new HttpRequest(); conn.once(Event.PROGRESS, this, onHttpRequestProgress); conn.once(Event.COMPLETE, this, onHttpRequestComplete); conn.once(Event.ERROR, this, onHttpRequestError); var buffBody=new Byte(); buffBody.endian=Byte.BIG_ENDIAN; buffBody.writeInt32(9); buffBod...

来源: Laya_社区 发布时间: 20160726

7. 如何创建一个json对象 [ 88%]

...stringify("a","1"); js.uname ="sdfsdf"; js.pss ="sdfsdf"; console.log(js); this.hr.send(url, js,"post","text"); 服务器端获取不到值只是 [object JSON] this.hr.send(url, js,"post","json"); 会报错,发送失败 2017-05-09 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到...

来源: Laya_社区 发布时间: 20170509

8. socket通讯返回数据 [ 87%]

...a.Byte; constructor() { //初始化引擎 Laya.init(600, 400, Laya.WebGL); this.byte = new Laya.Byte(); //这里我们采用小端 this.byte.endian = Laya.Byte.LITTLE_ENDIAN; this.socket = new Laya.Socket(); //这里我们采用小端 this.socket.endian = Laya.Byte.LITTLE_ENDIAN; //建立连接 this...

来源: Laya_社区 发布时间: 20180211

9. 求解关于跨域的具体操作 [ 86%]

...-Type','application/x-www-form-urlencoded'); xhr.once(Laya.Event.COMPLETE, this, this.completeHandler, [url, loader]); xhr.once(Laya.Event.ERROR, this, this.errorHandler); console.log("-----------------send------------------", url); xhr.send(url, "", "get", "arraybuffer"); 2018-07-04 添加评论 ...

来源: Laya_社区 发布时间: 20180704

10. HttpRequest如何发送JSON数据 [ 84%]

...new laya.net.HttpRequest();         logReq.once(Laya.Event.COMPLETE,this,this.onComplete);         logReq.send("http://127.0.0.1:3001/login", "username: 'lxd', password: 'lxd'",         'post', "json", null); 服务端无法获取数据 2017-09-06 4 条评论 免费帖 --> 分...

来源: Laya_社区 发布时间: 20170906