I am currently working on an Angular 6 service where I am attempting to modify a record, but the system is indicating that I do not have authorization.
At this moment, my code looks like this:
const httpOptions = {
headers: new HttpHeaders({'Content-Type': 'application/json'})
};
update(id, title, content) {
const updateData = { id: id, title: title, content: content };
return this.http.put(`http://myurl/${id}`, updateData, httpOptions);
}
Here is my query:
How can I implement basic authorization in my httpOptions or should I directly add it to the update method?