title: How to pass a simple integer parameter in HTTP GET request?
body: <p>I have the following code in my component, which is supposed to send an id to the WebApiController and fetch back some data. But I can't simply pass the parameter to the method. I have tried many of the solutions available here and there, but no success.</p>
  
  <pre class="lang-ts prettyprint-override"><code>getUser(id){
      this._http.get('http://localhost:53226/api/UserAPI/GetSpecificUser', id) // is there a simple way to do this?
      .subscribe((result: any) =&gt; {
      this.specificuser = result.json();
      console.log(this.specificuser);
      });
  }
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>This is the method in my controller. </p>
  
  <pre><code>public UserModel GetSpecificUser(int id)
  {
      var user = UserDB.Users.FirstOrDefault(x =&gt; x.id == id);
  
      var config = new MapperConfiguration(cfg =&gt; {
      cfg.CreateMap&lt;User, UserModel&gt;();
      });
      IMapper iMapper = config.CreateMapper();
      var destination = iMapper.Map&lt;User, UserModel&gt;(user);
  
      return destination;
  }
  </code></pre>