I am using get method to send 4 data (id , token , ROLE , EMPCODE) in header ,
i am getting error
ERROR HttpErrorResponse {headers: HttpHeaders, status: 403, statusText: "Forbidden"
my token is correct , it I checked in Postman , and I am getting response with status 200 , but I am facing this issue in my Project
I am sharing my code for service file
employeeData( id , token , role , employeeCode){
let headers = new HttpHeaders();
headers.append('id', id);
headers.append('TOKEN', token);
headers.append('ROLE', role);
headers.append('EMPCODE' , employeeCode);
headers.append( 'Content-Type' , 'application/json');
return this.http.get(this.emp_data, {headers: headers});
}
I am sharing code from Component where I have subscribed for getting response .
viewdetails(){
this.rest.employeeData(this.userId,this.token,this.role, this.employeeCode).subscribe(
result => {
console.log('hello');
console.log(result);
})
}
When I checked in Browser's Network Header , I can check Header that I am passing on request is not passed there .