const headers = new HttpHeaders({ 'Content-Type': 'text/xml' });
headers.append('Accept', 'text/xml');
headers.append('Content-Type', 'text/xml');
this.http.get('getxmlurl', {headers: headers}).subscribe(response => {
return '1234';
});
Hi I am using angular 4 httpclient to make a http get request from a spring controller which returns a XML response.
The problem I have is the response is ALWAYS NULL even though I can see the xml response from the chrome developer network tab.
I thought it might be something to do with the request header, angular 4 defaults to json however I am unable to change the request header with the code above. Can someone please advice.
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…