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

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

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

...    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.0下是正常的...

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

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

...p://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

3. HttpRequest post 请求不能传对象? [ 96%]

...me/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 添加评论 免费帖 --> 分享 微博 QZO...

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

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

...同来自: 已解决 header需要添加 var headers = [ "Content-Type", "application/x-www-form-urlencoded", 'C-Sign', sign ]; 2018-09-16 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 该问题目前已经被锁定, 无法添加新回复 发起人 魂影 相关问题 有什...

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

5. HTTP通信 · LayaAir3.3 · 引擎文档 · LAYABOX [ 92%]

...件,如浏览器的类型和版本)等。例如,“Accept: text/html,application/xhtml+xml,application/xml;q = 0.9,image/webp,image/apng,/;q = 0.8” 表示客户端可以接受多种内容类型,并且对不同类型有不同的优先级(通过 q 值表示)。 1.2 HTTP响应的组成 ...

来源: Laya3.0_文档 发布时间: 20251010

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

..."{"a":1}",到服务器上变成了 "{"a":1}"="",content-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,...

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

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

...s: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.CommonData.Uu...

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

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

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

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

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

...调用 request.send(url + method, data, "post", "json", ["Content-Type","application/json","Authorization", "Bearer " + PlayerModel.Instance.token]);   大部分时候正常  但有20%的几率会触发error事件回调,收到的message为"failed Status:0 text:"   只在本次运行的第一次...

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

10. HttpRequest 回调方法都没执行 LayaAir 1.7.17 beta JS版本 [ 78%]

...his.http.send(url,JSON.stringify(request), 'post', 'text',["content-type","application/json"]); } function onProgress(e) { console.log("run onProgress"); } function onComplete(e) { console.log("run onComplete"); console.log(this.http.data); } function onError(e) { console.log("run onError"); } 2018-...

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