title: ASP.NET Web API - Multiple POST methods on one controller?
body: <p>I've been trying to add a second POST method to the default ValuesController class that will take an id parameter and act identical to the PUT method, like so:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Net.Http;
  using System.Web.Http;
  
  namespace WebCalendar.Controllers {
      public class ValuesController : ApiController   {
          // GET /values
          public IEnumerable&lt;string&gt; Get()             {
              return new string[] { "value1", "value2" };
          }
  
          // GET /values/5
          public string Get(int id) {
              return "value";
          }
  
          // POST /values
          public void Post(string value) {
          }
  
          // POST /values/5
          public void Post(int id, string value) {
              Put(id, value);
          }
  
          // PUT /values/5
          public void Put(int id, string value){
          }
  
          // DELETE /values/5
          public void Delete(int id) {
          }
      }
  }
  </code></pre>
  
  <p>Problem is, when I add this second post method, any time I make a POST request, I get the error:</p>
  
  <pre><code>"No action was found on the controller 'values' that matches the request."
  </code></pre>
  
  <p>If I comment out one of the methods (doesn't matter which one), POST will work with the other method. I've tried renaming the methods, and even using <code>[HttpPost]</code> on both of them, but nothing has worked.</p>
  
  <p>How can I have more than one POST method in a single ApiController?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here is the only route that I'm using:</p>
  
  <pre><code>routes.MapHttpRoute(
      name: "DefaultApi",
      routeTemplate: "{controller}/{id}",
      defaults: new { controller = "values", id = RouteParameter.Optional }
  );
  </code></pre>