title: parameters not being passed in to api controller from $http.post
body: <p><strong>AngularJS:</strong></p>
  
  <pre><code>$http.defaults.headers.post["Content-Type"]= "application/x-www-form-urlencoded";
  
  $http({
      url: 'http://localhost:17438/api/people/PostPerson/',
      method: "POST",
      data: { name: vm.parent[i].name, dob: '01/15/2001', email: vm.parent[i].email, phone: vm.parent[i].cell, carrierName: vm.parent[i].carrier, personTypeID: 1 }
  })
  .then(function (response) {
      // success
      alert('sucess : ' + response);
  },
  function (response) { // optional
      // failed
      alert('failure : ' + response);
  });
  </code></pre>
  
  <p>I've also tried this variation:</p>
  
  <pre><code>var data = { name: vm.parent[i].name, dob: '01/15/2001', email: vm.parent[i].email, phone: vm.parent[i].cell, carrierName: vm.parent[i].carrier, personTypeID: 1 };
  $http.post('http://localhost:17438/api/people/PostPerson/', data);
  </code></pre>
  
  <p><strong>Parameters being passed:</strong></p>
  
  <pre><code>{"name":"jv","dob":"01/15/2001","email":"j@live.com","phone":"5551212","carrierName":"Sprint","personTypeID":1}:
  </code></pre>
  
  <p><strong>webAPI:</strong></p>
  
  <pre><code>[HttpPost]
  [HttpOptions]
  public string PostPerson(newUserRegistration newReg)
  {
      var json = JsonConvert.SerializeObject(0);
      person myPerson = new person();
      myPerson.personName = newReg.name;
      myPerson.personEmail = newReg.email;
      myPerson.personPhone = newReg.phone;
      myPerson.personPhoneCarrier = newReg.carrierName;
      myPerson.personDOB = newReg.dob;
      myPerson.familyID = newReg.familyID;
      myPerson.personTypeID = newReg.personTypeID;
  
      db.people.Add(myPerson);
      db.SaveChanges();
  
      return "got here";
  }
  
  public class newUserRegistration
  {
      public string name { get; set; }
      public string email { get; set; }
      public string phone { get; set; }
      public string carrierName { get; set; }
      public DateTime dob { get; set; }
      public string registrationID { get; set; }
      public int familyID { get; set; }
  
      public int personTypeID { get; set; }
  }
  </code></pre>
  
  <p><strong>Parameter population:</strong></p>
  
  <p>I know it is hard to read but you can see the values I'm passing in are NOT being passed into my <code>newUserRegistration</code> object</p>
  
  <p><a href="https://i.stack.imgur.com/T8bKm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T8bKm.png" alt="enter image description here"></a></p>
  
  <p>I've looked at several questions on Stack that seems to reference this type of issue.</p>
  
  <p><a href="https://stackoverflow.com/questions/23925540/angular-post-to-web-api-doesnt-pass-data">Angular POST to Web API doesn&#39;t pass data</a></p>
  
  <p><a href="https://stackoverflow.com/questions/19924473/issue-in-angularjs-http-post-to-webapi">issue in Angularjs $http.post to webapi</a></p>
  
  <p>This project is currently using 1.3.15 - I'm not sure if upgrading to 1.5 help?  </p>
  
  <p>What am I missing on this?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>There was a comment that is now gone, but I stringified the data as suggested:</p>
  
  <pre><code>var data = JSON.stringify({ name: vm.parent[i].name, dob: '01/15/2001', email: vm.parent[i].email, phone: vm.parent[i].cell, carrierName: vm.parent[i].carrier, personTypeID: 1 });
  
  $http.post('http://localhost:17438/api/people/PostPerson/', data);
  </code></pre>
  
  <p>I noticed something strange though.  It is calling the API method 2 times, the 1st time has null data (as witnessed originally), but it calls it a 2nd time and the data is there!</p>
  
  <p>I'm not sure why it is being called twice though?  Is there anything I'm doing incorrectly now that I'm stringifying the data?</p>
  
  <p><strong>Update to double call:</strong></p>
  
  <p>I noticed the following:
  <a href="https://i.stack.imgur.com/hRr36.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hRr36.png" alt="enter image description here"></a></p>
  
  <p>You will notice one says OPTIONS and the other says POST.  Now the webAPI also has the following tags:</p>
  
  <pre><code>[HttpPost]
  [HttpOptions]
  </code></pre>
  
  <p>If I removed the Options, it fails (can't find 404).  Do these tags have something to do with this?</p>