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

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

1. HttpRequest如何发送JSON数据 [ 100%]

HttpRequest如何发送JSON数据 发送JSON数据         var logReq = 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...

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

2. HttpRequest设置header后发送的参数不会自动转成json [ 98%]

HttpRequest设置header后发送的参数不会自动转成json 设置header参数后,要发送的数据data就不会自动转成json,导致请求失败,查看源码发现只有不设置header的情况下,才会自动转换data   附件 : --> 2023-10-10 添加评论 免费帖 --> 分享 ...

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

3. HttpRequest无法发送除字符串以外的数据 [ 97%]

HttpRequest无法发送除字符串以外的数据 laya现在的HttpRequest类无法发送字符串以外的数据,服务器收到的都是空的,我看了下源码, ,10905行的http.send(data)可能需要改一下,我用XMLHttpRequest类send()的时候,json数据都是先用JSON.string...

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

4. request failed status:0 text: IOS HttpRequest [ 97%]

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

5. HttpRequest请求头加入自定义的userId和token,总是报错 [ 96%]

HttpRequest请求头加入自定义的userId和token,总是报错 {"state":500,"msg":"Unexpected token < in JSON at position 0"} 2018-08-31 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 1 个回复 阿耀 赞同来自:...

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

6. laya.net.HttpRequest_API3.0 [ 96%]

...lic/Protected All Inherited Externals Only exported Menu Globals "laya/net/HttpRequest" HttpRequest Class HttpRequest HttpRequest 通过封装 HTML XMLHttpRequest 对象提供了对 HTTP 协议的完全的访问,包括做出 POST 和 HEAD 请求以及普通的 GET 请求的能力。 HttpRequest ...

来源: Laya3.0_api 发布时间: 20231115

7. ResourceVersion在调用HttpRequest.send时很慢,花费十多秒才读取到文件 [ 95%]

ResourceVersion在调用HttpRequest.send时很慢,花费十多秒才读取到文件 ResourceVersion加载本地的资源版本管理文件manifest.json(该文件内只有空对象{ })花费时间超过十秒 追踪代码后发现HttpRequest.send之后onProgress回调特别慢 该问题目前...

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

8. HttpRequest post方式 怎么传数组或者对象 [ 93%]

HttpRequest post方式 怎么传数组或者对象 教程里是xhr.send("http:xxx.xxx.com","a=xxxx&b=xxx","post","text"); 第二个参数是string的,如果其中一个变量a是数组怎么写 2018-08-09 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请...

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

9. HttpRequest post 请求不能传对象? [ 93%]

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

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

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

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