title: Cannot POST data to server through angularjs's $http module
body: <p>I am coding using angular ajax. The client side code is:</p>
  
  <pre><code>$http({
      method: 'POST',
      url: '----/test.php',
      data: ({'txtDeviceID': 12345678}),
      headers: {
          'Content-type': 'application/text'
      }
  }).then(function successCallback(response) {
      console.log(response)
  }, function errorCallback(response) {
      console.log(response)
  });
  </code></pre>
  
  <p>The server side code is: </p>
  
  <pre><code>header('Access-Control-Allow-Origin: *');
  header("Access-Control-Allow-Headers: Origin, X-Requested-With,Content-Type, Accept");
  header('Access-Control-Allow-Methods: GET, POST, PUT');
  echo $_POST['txtDeviceID'];
  </code></pre>
  
  <p>Why can't I get the <code>texDeviceId</code>? Thank you for your time!</p>