I am trying to access the Location HttpResponse header value. There are plenty of examples of how this should be handled but I have been unable to get it to work.
HTTP Get call in service class
public beginIntegration(vendorName: string, baseUrl: string): Observable<HttpResponse<object>> {
return this.http.get<any>(`${baseUrl}${this.url}/begin-integration/${vendorName}`, { withCredentials: true, observe: 'response' });
}
Component Subscribe Request:
private clickBeginIntegrationButton(vendorName: string): void {
this.integrationsMarketplaceService.beginIntegration(vendorName, this.configuration.webLinkIntegrationsApiBaseUrl)
.subscribe(
(res) => {
this.banner.showSuccess(`Redirect URL - ${res.headers.get('Location')}`);
},
(error) => {
this.banner.showError('Error Getting Redirect URL');
}
);
}
The aren't any header values, it's not just that the location property doesn't exist. What am I missing?