title: can't get to web api controller action with jquery ajax post
body: <p>I'm trying to create my first REST application with the web api in mvc4.  I have a controller set up with the HttpPost verb but for some reason when I click the link to post the xml string to the controller I get an error - "{"Message":"No HTTP resource was found that matches the request URI '/api/Apply/ApplyToJob'.","MessageDetail":"No action was found on the controller 'Apply' that matches the request."}"  Any ideas what I might be doing wrong?  Here's the view page...</p>
  
  <pre><code>&lt;a href="javascript:void(0);" id="lnkPost"&gt;Post Data&lt;/a&gt;
  
  &lt;script type="text/javascript"&gt;
      window.onload = function () {
          $("#lnkPost").on("click", function () {
  
              $.get("/TestResponse.xml", function (d) {
                  $.ajax({
                      //contentType: "text/xml",
                      //dataType: "xml",
                      type: "post",
                      url: "/api/Apply/ApplyToJob",
                      data: {
                          "strXml": (new XMLSerializer()).serializeToString(d)
                      },
                      success: function () { console.log('success'); }
                  });
              });
          });
      };
  &lt;/script&gt;
  </code></pre>
  
  <p>and here's the controller.</p>
  
  <pre><code>public class ApplyController : ApiController
  {
      [HttpPost]
      [ActionName("ApplyToJob")]
      public string ApplyToJob(string strXml)
      {
          return "success";
      }
  }
  </code></pre>