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

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

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

打包app,http无法设置content-type 我明明设置了content-typejson,在浏览器里都正常,但是在手机运行器里就无法使用,我发的数据为"{"a":1}",到服务器上变成了 "{"a":1}"="",content-type也变成了application/x-www-form-urlencoded   代码如下: static...

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

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

...了 let headers:Array<any> = new Array<any>(); headers.push("Content-Type", "application/json") //headers={"Content-Type":"application/json"} //let answers={"answers":core.CommonData.DaTi,"examUuid":network.HttpHelper.compile(core.CommonData.Uuid),"openId":network.HttpHelper.compile(core...

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

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

...      });       hr.send(url, JSON.stringify(data), 'post', 'text', ['content-type', 'application/json;charset=UTF-8', "sessionid", this.sessionId]);       其中,['content-type', 'application/json;charset=UTF-8', "sessionid", this.sessionId]是http header请求头的参数,在LayaAir 1....

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

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

...} xhr.send("http://xxx/login", JSON.stringify(sendData), "post", "json", ["content-type","application/json"]);     function processHandler(data){ console.log (data) } function completeHandler(e){ console.log (xhr.data) }; function errorHandler(data){ console.log ('error') }  };     2018-08-24 ...

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

5. 求解关于跨域的具体操作 [ 83%]

...T",url, true) xhr.setRequestHeader("Accept", "*/*"); xhr.setRequestHeader("Content-Type", "application/json"); 还是说用参考代码里的HttpRequest() var xhr = new Laya.HttpRequest(); xhr.http.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xhr.once(Laya.Event.COMPLETE, th...

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

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

...05-24 11:55 可能写法有问题,我的写法 var auth_headers = ["Content-Type", "application/json"] auth_headers.push("token") auth_headers.push(WarM.instance.token),我这样是可以的,你把前面的东西加一加看看行不行 wuciqiang • 2018-05-24 16...

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

7. 如何添加header文件 [ 72%]

...链接 提交 1 个回复 132*****180 赞同来自: var auth_headers = ["Content-Type", "application/json"]; auth_headers.push("你需要的传的值"); 2018-04-03 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 182*****278 相关问题...

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

8. HttpRequest post 请求不能传对象? [ 70%]

...equestUrl + "/game/courtyard/take-down", "a=1&b=2", "post", "json", [ "Content-Type", "application/json; charset=utf-8", "token", getQueryString("token") ]); 按照官方方案请求使用"a=1&b=2"显示还是字符串   正确的应该是这样子: 2021-01-21 添加评论 免费帖 --> ...

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

9. 怎么使用http请求 [ 67%]

...ncoder(JSON.stringify(data)); xhr.open("POST", url); xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded'); xhr.send("value=" + baseStr); 这个怎么改成laya的http请求 2018-08-07 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与...

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

10. request failed status:0 text: IOS HttpRequest [ 65%]

...ce(Event.ERROR, this, onHttpRequestError); var headers = []; headers.push("Content-Type"); headers.push("application/json"); hr.send('http://xxxxxxxxxxxxxxxxxx', JSON.stringify(data), 'post', 'json',headers);<strong></strong>  浏览器 可以正常 访问 返回数据  alert("onHttpRe...

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