我正在使用Angular 1.0,当我进行XHR调用时,会将“连接:保持活动状态,'杂注:无高速缓存','高速缓存控制:无高速缓存'”添加到请求标头中。如何防止将其添加到XHR请求中?
如果传递此标头会发生什么?
答案 0 :(得分:0)
您在应用运行时冷掉配置头
module.run(function($http) {
$http.defaults.headers.common.Connection = '';
});
https://docs.angularjs.org/api/ng/service/$http#setting-http-headers