title: Angular 6 HTTP Get request with HTTP-Basic authentication
body: <p>I`m trying to access a URL with <em>Basic Authentication</em>.</p>
  
  <p>The URL returns JSON data.</p>
  
  <p>How can I add my username and password to this http request below? </p>
  
  <pre><code>private postsURL = "https://jsonExample/posts";
  
  getPosts(): Observable&lt;AObjects []&gt;{
      return this.http.get&lt;AObjects[]&gt;(this.postsURL); 
  }
  </code></pre>