title: HTTP Post to Web API 2 - Options request received and handled no further request received
body: <p>I have a web application using MVC and AngularJS, which connects to a Web API 2 api, that I have set up in a separate project. </p>
  
  <p>Currently I am able to retrieve information from the Api with no problems. </p>
  
  <p>However when I try to do a HTTP Post I am getting no response, originally I was getting a problem with the pre-flight request failing, I have now handled this in my controller, however it does not send the proper request after it has got an OK message back.</p>
  
  <p>I have included my code for the Angular Factory and the C# Controller in the API. </p>
  
  <pre><code>[EnableCors(origins: "*", headers: "*", methods: "*")]
  public class RegisterController : ApiController
  {
      public string Post()
      {
  
          return "success";
      }
  
      public HttpResponseMessage Options()
      {
          return new HttpResponseMessage { StatusCode = HttpStatusCode.OK };
      }
  }
  
  
  var RegistrationFactory = function($http, $q, ApiAddress) {
  return function(model) {
     // $http.post(ApiAddress.getApiAddress() + '/Register/Post', model.ToString());
  
      $http({
          method: "POST",
          url: ApiAddress.getApiAddress() + '/Register/Post',
          data: model,
          headers: { 'Content-Type': 'application/json; charset=utf-8' }
      }).success(function(data) {
          $location.path("/");
      });
  }
  };
  
  RegistrationFactory.$inject = ['$http', '$q', 'ApiAddress'];
  </code></pre>
  
  <p>Edit: </p>
  
  <p>I am still not having any joy with this, however I tested in Internet Explorer and it works with no problems at all. </p>
  
  <p>I have got it working in chrome by starting with web security disabled, however obviously this is not ideal as it will not work on a user PC with security enabled. </p>