title: cannot call post methods in asp
body: <p>I can only call to asp GET methods using ajax.
  This is my JavaScript:</p>
  
  <pre><code>$scope.test = function () {
      var dataObject = {};
      dataObject.Company_Code = companyCode;
      $http({
          method: 'POST',
          url: 'http://localhost:31041/api/Location/test',
          data: $.param(dataObject),
          headers: {
              'Content-Type': 'application/x-www-form-urlencoded',
              'Authorization': 'Bearer ' + token
          }
      })
   .success(function (data) {    
   }).error(function () {
   });
  }
  </code></pre>
  
  <p>And this is my WebAPI method:</p>
  
  <pre><code>[HttpPost]
  public string test(Company_Details Company)
  {
    return "11";
  }
  </code></pre>
  
  <p>My <code>global.asax</code> settings:</p>
  
  <pre><code>protected void Application_BeginRequest(object sender, EventArgs e)
          {
              HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*");
              if (HttpContext.Current.Request.HttpMethod == "OPTIONS")
              {
                  HttpContext.Current.Response.AddHeader("Cache-Control", "no-cache");
                  HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST, PUT");
                  HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept,Authorization");
                  HttpContext.Current.Response.AddHeader("Access-Control-Max-Age", "1728000");
                  HttpContext.Current.Response.End();
              }
          }
  </code></pre>
  
  <p>When I try to invoke this method I receive the following error:
  <a href="https://i.stack.imgur.com/cEpYH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cEpYH.png" alt="enter image description here"></a>
  and also i can invoke post method with URL parameters(<code>url: 'http://localhost:31041/api/Location/test?Name:123',</code>). but cannot pass data using <code>data: $.param(dataObject)</code> </p>