I have been attempting to make a GET request to SAP Business Objects that requires custom headers. I followed the Angular documentation on how to define these headers using the HttpHeaders class. However, it seems like the custom headers (X-...) are not being recognized.
Below is the code snippet where I create the headers and execute the GET request:
getEnvId(token: string) {
this.tokenHdr = {
headers: new HttpHeaders({
'Accept': 'application/json',
'Content-Type': 'application/json',
'Accept-Language': 'en-US',
'X-SAP-PVL': 'en-US',
'X-SAP-LogonToken': token
})
}
console.log(this.tokenHdr);
return this._http.get('http://' + this.environment + '/biprws/infostore/cuid_' + this.reportCuid, this.tokenHdr)
}
When logging the this.tokenHdr object, it displays as shown in the following image: https://i.sstatic.net/AECIx.png
The error response I receive is depicted here: https://i.sstatic.net/v9evM.png
Prior to this step, I am able to successfully retrieve the token and print it to the console. The token is obtained through a POST request without any custom headers, leading me to suspect that the issue lies with the custom headers.
Observing the Network tab in the browser's developer tools reveals additional insights: https://i.sstatic.net/48837.png