2017-10-05 33 views
0

我的后台是春天开机1.5.7和前端angular4.4.3,在Angular4 HttpClient.get,没有自定义标头的返回

响应不包括所有的标题实际上它仅包括高速缓存控制,内容类型,编译和到期 而不是那里的自定义页眉和返回所有别人的同时邮递员显示

constructor(private http2: HttpClient) { } 
listAll{ this.http2.get<ItemsResponse>('http://mysite:8080' , {observe: 'response'}).subscribe(resp => { 
console.log(resp.headers.get('xyz')); 
console.log(resp.body.response); 
} 
); 

回答

1

你允许对服务器CORS /揭露那些头?

+0

谢谢你得到了答案,它现在的作品 –