[]改变不了请求消息头,已近设置了
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.CommonData.Uuid)}
var xhr: Laya.HttpRequest = new Laya.HttpRequest();
xhr.http.headers=headers
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.Uuid)}
var xhr: Laya.HttpRequest = new Laya.HttpRequest();
xhr.http.headers=headers
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Aar0n
赞同来自:
XMLHttpRequest这个原生的类其实很庞大,功能很强大,laya的封装只是满足基本的需求,一些特殊的需求,需要自己进行扩展。