I´m trying to send token header in a http.post. I try this code but return in browser log:
Access Denied
const httpOptions = {
headers: new HttpHeaders({
"Authorization": "Token " + localStorage.getItem("token")
})
};
getCron() {
console.log(httpOptions);
return this.http.post(
"URL", httpOptions);
}
console.log return the correct token, so this isn´t the error. The error is that i don´t know how to add exactly header token in the call. So the question is: How can i add this token in the call?