title: Angular 5 HttpClient Path Variable
body: <p>I'm developing an Angular Client for a REST API.</p>
  <p>My api exposes URL like:</p>
  <pre><code>https://server.com/users/detail/3
  </code></pre>
  <p>Where 3 is a parameter.</p>
  <p>I try to generate a path variable using Angular Client but I have not been able. I try</p>
  <pre><code>getUser(username: string) {
  const options = {
    params: new HttpParams().set('username', username)
  };
  
  return this.http.get&lt;User&gt;('detail/{username}', options); }
  </code></pre>
  <p>But the result isn't correct.
  Can someone help me?</p>
  <p><em>EDIT</em></p>
  <p>After I try the solutions, it doesn't still work. If</p>
  <pre><code> getUser(username: string) {
  const options = {
    params: new HttpParams().set('username', username)
  };
  
  const resource = 'detail/' + username;
  return this.http.get&lt;any&gt;(resource);  }
  </code></pre>
  <p>This solution seems me too poor, Has Angular HttpClient any solution for this?</p>