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

大约有 17 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0028 秒)

1. 打包app,http无法设置content-type [ 100%]

...-type也变成了application/x-www-form-urlencoded   代码如下: static httpRequest(method:string, url:string, data:any, headers:Array<string>, cb:(err:Error, data?:any)=>void) { let req = new Request(); req.on(Event.COMPLETE, this, (data) => { cb(null, data); }); req.on(Event.ERROR, ...

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

2. 使用HttpRequest 请求的头部信息headers参数结果异常 [ 91%]

使用HttpRequest 请求的头部信息headers参数结果异常 如题 具体情况可以见附件  在使用 HttpRequest headers参数的时候 得到的结果异常 哪儿大佬可以帮忙看看 附件 : --> 2018-05-23 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关...

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

3. 改变不了请求消息头,已近设置了 [ 88%]

...),"openId":network.HttpHelper.compile(core.CommonData.Uuid)} var xhr: Laya.HttpRequest = new Laya.HttpRequest(); xhr.http.headers=headers 2018-02-08 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 1 个回复 Laya_Aaron 赞同...

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

4. 求解关于跨域的具体操作 [ 81%]

... 之前我个人写的 不知道是不是在这个里面 var xhr = new XMLHttpRequest(); xhr.open("GET",url, true) xhr.setRequestHeader("Accept", "*/*"); xhr.setRequestHeader("Content-Type", "application/json"); 还是说用参考代码里的HttpRequest() var xhr = new Laya.HttpRequest(); xhr.http.s...

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

5. XMLRequest在layaNative下请求崩溃,请求官方协助! [ 81%]

...(this: void, data: JSON) => void): void {         let hr = new Laya.HttpRequest();         hr.once(Laya.Event.COMPLETE, this, (e: any): void => {             callback(JSON.parse(hr.data));         });       hr.send(url, JSON.stringify(data), 'post', 'text', ['content-type'...

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

6. 关于HttpRequest报错问题 [ 80%]

关于HttpRequest报错问题 var xmlHttp = new Laya.HttpRequest(); xmlHttp.open("POST", url, true); xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8"); xmlHttp.once(Event.COMPLETE,this,onHttpRequestComplete); xmlHttp.once(Event.ERROR,this,errorHandler); xml...

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

7. HttpRequest post 请求不能传对象? [ 80%]

HttpRequest post 请求不能传对象? 代码: xhr.send(requestUrl + "/game/courtyard/take-down", "a=1&b=2", "post", "json", [ "Content-Type", "application/json; charset=utf-8", "token", getQueryString("token") ]); 按照官方方案请求使用"a=1&b=2"显示还是字符串   正确...

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

8. request failed status:0 text: IOS HttpRequest [ 77%]

request failed status:0 text: IOS HttpRequest var data = { rechargeId:"1", consumerId:"533", } alert(JSON.stringify(data)); hr = new HttpRequest(); hr.once(Event.PROGRESS, this, onHttpRequestProgress); hr.once(Event.COMPLETE, this, onHttpRequestComplete); hr.once(Event.ERROR, this, onHttpRequestErr...

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

9. HttpRequest有一定几率触发error事件 Status:0 [ 75%]

HttpRequest有一定几率触发error事件 Status:0 在微信开发者工具中,调用 request.send(url + method, data, "post", "json", ["Content-Type","application/json","Authorization", "Bearer " + PlayerModel.Instance.token]);   大部分时候正常  但有20%的几率会触发error事件...

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

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

...gin = function (){ console.log ('按了登录按钮')  var xhr = new Laya.HttpRequest(); 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:"...

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