title: AngularJS $http.put PUT Method not sending Data
body: <p>I'm switching from jquery $.ajax, which was working fine, to using AngularJS $http.put to access a restful API.</p>
  
  <p>I can make an API call, but the PUT data isn't getting sent - so my API sees a PUT request with an empty data object, which should contain a JSON string -> <code>data.values = 'a json structure'</code></p>
  
  <pre><code>$http.put(
      $rootScope.api_url,
          {
              values: jsonifiedValues
          },
          {
          headers: {
              apihash: sha256hash
          }
      }).success(function(data,status,headers,config){
          // handle success
  }).error(function(data,status,headers,config) {
          // handle failure
  });
  </code></pre>
  
  <p>I've not used AngularJS's $http before, but when I dump out the data in my PHP api it's just empty. this is how I'm pulling it from the request in the PHP:</p>
  
  <pre><code>parse_str(file_get_contents('php://input'), $put_vars);  
  $arr_req_data = $put_vars['values'];    
  </code></pre>
  
  <p>In my API if the apihash sent from the request doesn't match the sha256 hash built on the PUT values, it fails.</p>
  
  <p>This is working in JQuery, just failing now I've switched to $http. I'm not sure why the PUT data seems to be empty.</p>