title: Web API routing with multiple parameters
body: <p>I'm trying to work out how to do the routing for the following Web API controller:</p>
  
  <pre><code>public class MyController : ApiController
  {
      // POST api/MyController/GetAllRows/userName/tableName
      [HttpPost]
      public List&lt;MyRows&gt; GetAllRows(string userName, string tableName)
      {
          ...
      }
  
      // POST api/MyController/GetRowsOfType/userName/tableName/rowType
      [HttpPost]
      public List&lt;MyRows&gt; GetRowsOfType(string userName, string tableName, string rowType)
      {
          ...
      }
  }
  </code></pre>
  
  <p>At the moment, I'm using this routing for the URLs:</p>
  
  <pre><code>routes.MapHttpRoute("AllRows", "api/{controller}/{action}/{userName}/{tableName}",
                      new
                      {
                          userName= UrlParameter.Optional,
                          tableName = UrlParameter.Optional
                      });
  
  routes.MapHttpRoute("RowsByType", "api/{controller}/{action}/{userName}/{tableName}/{rowType}",
                      new
                      {
                          userName= UrlParameter.Optional,
                          tableName = UrlParameter.Optional,
                          rowType= UrlParameter.Optional
                      });
  </code></pre>
  
  <p>but only the first method (with 2 parameters) is working at the moment. Am I on the right lines, or have I got the URL format or routing completely wrong? Routing seems like black magic to me...</p>