开发者社区 问答 正文

如何在xhr的header内写入referer 400 请求报错 

uwp+js 网络请求(angular或者winjs)

uwp+js  网络请求(angular或者winjs) 如何在header内写入referer 已经尝试直接写入,referer会被过滤掉

 // winjs WinJS.xhr({ url: target_url, type: 'GET', headers : { asdf:'asf', referer : 'http://y.qq.com/' } }).then(function(response){
  

});

// angular $http({ url: target_url, type: 'GET', headers : { asdf:'asf', referer : 'http://y.qq.com/' } }).then(function(response){

});

以上两种在header里都只会出现asdf

展开
收起
kun坤 2020-05-30 16:20:57 985 分享 版权
1 条回答
写回答
取消 提交回答
  • 通过winjs调用uwp提供的网络接口,而不是用winjs或者angular内置的ajax Windows.Web.Http.HttpClient()  ######请问xhrhttp可以跨域的吗?######这算是客户端程序,好像没遇到域的问题

    2020-05-30 16:21:02
    赞同 展开评论
问答分类:
问答地址: