title: What is the best way to retrieve data using Web API 2 and AngularJS
body: <p>I am just learning on how to use Web API with angular but I am having a few issues on retrieving data and I would appreciate it if someone could help me.</p>
  
  <p>I have a controller called GetUserController  with the following methods.</p>
  
  <pre><code> public class GetUserController : ApiController
      {
          [HttpGet]
          public string GetUserName()
          {
              var user = "John Doe"
              return user;
          }
  
  
          [HttpGet]
          public string GetUserName2()
          {
              string user = "Jane Doe";
              return user;
          }
  
      }
  
  //Angular side of things 
       function getUser() {
              return $http.get('/api/GetUser').then(function (data) {
                  return data;
  
              });
          }
  </code></pre>
  
  <p>The above code works fine and and returns the first user from the controller . however when I try to get the second by using the below angular code:</p>
  
  <pre><code> function getUser() {
          return $http.get('/api/GetUser/GetUserName2').then(function (data) {
              return data;
  
          });
      }
  </code></pre>
  
  <p>This does not work for some reason  it says it can't find the GetUserName2 method. Am I missing something ? Please help?</p>
  
  <p>EDIT: The error i'm getting is : Multiple actions were found that match the request</p>