I am trying to do put request to the server ,but I am getting 401 error
The provider
putData(){
header = header.append('Content-Type', 'application/json');
header = header.append('Accept', 'application/json');
header = header.append('Authorization', 'Bearer');
return this.http.put('http://something//', {headers: header})
.subscribe((result: any) => {
console.log(result);
}, (errorResponse) => {
console.error(errorResponse);
}
home.ts
this.MyProvider.putData();
I have attach the network header as well since the first request success, but the second does not ?!!!