Can anyone tell me if this is the correct way to add headers to http requests in Angular 6?
When I make the call via SwaggerUI, I can see the headers should be:
url -X GET --header 'Accept: application/json' --header 'zumo-api-version: 2.0.0' 'https://myurl/tables/stuff'
so I have added the following:
let headers: HttpHeaders = new HttpHeaders();
headers = headers.append('HttpHeader1', 'Accept:application/json');
headers = headers.append('HttpHeader2', 'zumo-api-version:2.0.0');
And then the call:
getStuff(){
return this.http.get('https://myurl/tables/stuff', {headers})
}
There is no failure but nothing is returned, and I know that there should be.
thanks
UPDATE
Have just noticed that the url in my call is actually https not http, would that make any difference?
getStuff(){
return this.https.get('https://myurl/tables/stuff', {headers})
}