Angular 6 - httpClient passing basic auth in httpOptions : <p>I have a service in Angular 6 and I'm trying to change a record but it's saying I'm not authorized.</p>

<p>Right now I have this:</p>

<pre><code>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);
  }
</code></pre>

<p>My question is:</p>

<p>How to I add basic authorization to my httpOptions or do I add it direct to the update method?</p>
