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

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

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

...nd(this.urlString, this.dataAny, this.methodString, this.responseType,this.headers); 2019-03-08 添加评论 已悬赏10元 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 2 个回复 nevercai 赞同来自: 这是因为跨域了,服务器有返回...

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

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

...d   代码如下: 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, this, (err) => { console.error(err); cb(err); ...

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

13. WebSocket connection to 'ws://192.168.0.8:8102/' failed: Invalid frame header [ 83%]

WebSocket connection to 'ws://192.168.0.8:8102/' failed: Invalid frame header 一开始连接正常,密集发送消息到服务器后,就会给服务器程序发送关闭连接的信息。WebSocket connection to 'ws://192.168.0.8:8102/' failed: Invalid frame header WebSocket connection to 'ws:/...

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

14. 解决跨域相关! [ 82%]

...名下加上跨域标识,这里以nginx为例: http {   ......   add_header Access-Control-Allow-Origin *;   add_header Access-Control-Allow-Headers X-Requested-With;   add_header Access-Control-Allow-Methods GET,POST,OPTIONS;   ...... } 这样就可以实现GET,POST,OPTIONS的跨域请求...

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

15. 使用HttpRequest向外部链接请求ip所在省份时,遇到 No 'Access-Control-Allow-Origin' header错误 [ 82%]

...部链接请求ip所在省份时,遇到 No 'Access-Control-Allow-Origin' header错误 想实现的功能是获得当前ip所在省份 经度娘查得: 新浪的IP地址查询接口:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js 尝试了两种方式: 1.  <script type="text/...

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

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

...nHttpRequestComplete); hr.once(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>  浏览器 可以正常 访问 ...

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

17. HttpRequest问题 [ 80%]

...18-02-08 14:11 看了下,我们是数据请求,重新修改后也加了header("Access-Control-Allow-Origin: *"),发布后还是这种情况。。重点是我们现在请求的并不是自己的服务器,是请求微信支付接口的。。这种要如何解决啊? qian • 2018-0...

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

18. laya.net.HttpRequest_API3.0 [ 80%]

...| "post" | "head", responseType?: "text" | "json" | "xml" | "arraybuffer", headers?: string[]): void Defined in laya/net/HttpRequest.ts:46 发送 HTTP 请求。 Parameters url: string 请求的地址。大多数浏览器实施了一个同源安全策略,并且要求这个 URL 与包含脚本的文...

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

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

...pe', 'application/json;charset=UTF-8', "sessionid", this.sessionId]是http header请求头的参数,在LayaAir 1.0下是正常的,在LayNative 1.0 (版本:1.72)下会使APP崩溃退出,必然出现,问题在于sessionid参数,这个是我们自定义的header,如果去掉就不会崩...

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

20. 网络通信 · LayaAir3文档 · LAYABOX [ 77%]

...ccess-Control)请求时,是否使用认证信息(例如cookie或授权的header)。 默认为 false timeout number 请求超时时间 2,方法 abort() 如果请求已经被发送,则立刻中止请求。 getAllResponseHeaders() 返回所有响应头信息(响应头名和值), 如果响应头...

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