Authorization header not sent with http request angular 6 with OPTIONS method
问题 I am getting 401 error while sending post request using the angular code, when I inspected network request I found out that the headers are not being sent along the post request, please see the image: auth.service.ts login(username: string, password: string) { let httpHeaders = new HttpHeaders({ 'Authorization': 'Basic bXktdHJ1c3RlZC1jbGllbnQ6c2VjcmV0', 'Content-Type': 'application/json' }); let options = { headers: httpHeaders }; this.http.post( 'http://localhost:8080