title: DNN WebAPI POST always returns a 404 Not Found Error
body: <p>I have no problem with GET requests when I try the WebAPI method of doing services in DNN. However, I can't for the life of me get a POST request to return anything but a HTTP 404 Not Found error.  Both the GET and POST methods are in the same controller. </p>
  
  <p>I reviewed similar questions and confirmed that my folder names are standard, IIS is not running application folders, and I don't have an additional web.config.  </p>
  
  <p>I also installed dnnGlimpse and verified that my route was registered.</p>
  
  <p>This is DNN 7.3.4 and a clean project - it's not from a VS template.</p>
  
  <p>This is an example of my route mapper.</p>
  
  <pre><code>public class RouteMapper : IServiceRouteMapper
  {
      public void RegisterRoutes(IMapRoute mapRouteManager)
      {
          mapRouteManager.MapHttpRoute("MyModule", "default", "{controller}/{action}", new[] { "MyCompany.Modules.MyModule.Controllers" });
      }
  }
  </code></pre>
  
  <p>This is an example of my post method.  I can't even hit a breakpoint anywhere in this method.  This class is in a folder named "Controllers."</p>
  
  <pre><code>namespace MyCompany.Modules.MyModule.Controllers
  {
      public class ExampleController : DnnApiController
      {
          [AllowAnonymous]
          [ValidateAntiForgeryToken]
          [HttpPost]
          public HttpResponseMessage CustomObjectType(string value)
          {
              try
              {
                  var oType = CustomObjectTypeHelper.GetObjectType(value);
  
                  switch (oType)
                  {
                      case CustomObjectType.Type1:
                          return Request.CreateResponse(HttpStatusCode.OK, "type1");
                      case CustomObjectType.Type2:
                          return Request.CreateResponse(HttpStatusCode.OK, "type2");
                      case CustomObjectType.Type3:
                          return Request.CreateResponse(HttpStatusCode.OK, "type3");
                      case CustomObjectType.Type4:
                          return Request.CreateResponse(HttpStatusCode.OK, "type4");
                      default:
                          throw new ArgumentOutOfRangeException("value", "Value format does not match a supported custom object type.");
                  }
              }
              catch(Exception ex)
              {
                  Exceptions.LogException(ex);
                  return Request.CreateErrorResponse(HttpStatusCode.InternalServerError,
                      "Card number format does not match a supported card type.");
              }
          }
      }
  }
  </code></pre>
  
  <p>Here is an example of how I have called it.</p>
  
  <pre><code>var sf = $.ServicesFramework(&lt;%=ModuleId %&gt;);
  var serviceUrl = sf.getServiceRoot('MyModule');
  
  function getObjectType() {
      var strNumber = $('&lt;%=txtNumber.ClientID %&gt;').val();
  
      try
      {
          $.ajax({
              type: "POST",
              cache: false,
              url: serviceUrl + "Example/CustomObjectType",
              beforeSend: sf.setModuleHeaders,
              data: strNumber
          }).success(function(data, textStatus, jqXHR) {
              alert(data);
          }).fail(function (xhr, result, status) {
              alert("Uh-oh, something broke: " + status);
          });
      } catch (e) {
          //Shouldn't do this but it's just for testing
          alert(e.stack);
      }
  }
  </code></pre>