title: Http get request with username and password ionic 4
body: <p>I m trying to do a get request from my ionic 4 project but I need to use username and password for it or else I get error 403</p>
  
  <p>here is my code :</p>
  
  <pre><code>  constructor(public httpClient: HttpClient){
      this.items = this.httpClient.get('http://www.fostania.com/api/items/');
  this.items.subscribe(data =&gt; {
    console.log('my data: ', data);
  })
  }
  </code></pre>
  
  <p>Where should i add the username and password for this??</p>
  
  <p><strong><em>UPDATE</em></strong></p>
  
  <p>tried to do it like <code>'http://username:password@www.fostania.com/api/items/'</code></p>
  
  <p>but still gives me the error </p>
  
  <pre><code>HttpErrorResponse {headers: HttpHeaders, status: 403, statusText: "Forbidden", url: "http://www.fostania.com/api/items/", ok: false, …}
  </code></pre>