title: Simple GET Request in .NET MVC 4
body: <p>I am trying to make a GET request to my server to fetch Messages giving 2 parameter. I send this GET request:</p>
  
  <pre><code>http://localhost:62020/api/Chat/GetRecentMessages?RoomId=1&amp;LastMsgId=0 
  </code></pre>
  
  <p>And my controller should handle it:</p>
  
  <pre><code>[HttpGet]
          private List&lt;ChatMessage&gt; GetRecentMessages(int RoomId, int LastMsgId)
          {
  
  
              int count = 0;
              int timeout = 30;
              int timeoutCount = 0;
              List&lt;ChatMessage&gt; messages = new List&lt;ChatMessage&gt;();
  
              //go until we get a result or we time out
              while (count == 0 &amp;&amp; timeout &gt;= timeoutCount)
              {
                  var result = Db.ChatMessages.Where(r =&gt; r.RoomId == vm.RoomId).Where(r =&gt; r.Id &gt; vm.LastMsgId); // Get all messages from Room that are more recent than last message
                 count = result.Count();
  
                  if (count == 0)
                  {
                      Thread.Sleep(1000);
                      timeoutCount++;
                  }
                  else
                  {
                     messages = result.ToList();
                  }
              }
  
              return messages;
          }
  </code></pre>
  
  <p>But I keep getting a 404 errors saying that it could not find this route. What do I need to do on my controller side in order to get these 2 values?</p>