我正在尝试通过HTTP标头传递值 这是我的代码
this.ParamObj = {'companyId': this.TenandtID , 'groupId': this.SiteID ,
'userId': this.userID, 'ticket': this.TangoToken, 'tangoApplicationName':
'BUI' };
const two = JSON.stringify(this.ParamObj);
const headers = new HttpHeaders()
.set('Content-Type', 'application/json')
.set('Authorization', 'Bearer ' + this.TangoToken)
.set('Tango-Context', two);
this.http.get(environment.GetTangoApps, { responseType: 'text', headers: headers }).subscribe(res => {
console.log(res);
});
不能通过它 作为响应,我得到403和跨域错误