I am trying to use HTTPClient to upload a form to my backend server (Java/Springboot). When I try to add the authorization header, the network debug does not show the header added in my post request for upload.
Here is the code that I am using
import { HttpClient, HttpHeaders } from '@angular/common/http';
.....
....
let httpHeaders = new HttpHeaders();
httpHeaders = httpHeaders.set('Authorization', 'Bearer ' + AuthService.getToken());
this.http.post(serverURL, formData, {headers : httpHeaders}).subscribe(
(res) => console.log('server response =' + JSON.stringify(res)),
(err) => console.log('server err =' + JSON.stringify(err))
);
Here are the screenshots from the network debug
Can some one please suggest what could have caused this?