title: Ionic framework http post request
body: <p>I want to send a <code>POST</code> request to a remote php file from an ionic app to save base64 encoded data in the database. When i pass <code>POST</code> data, I can see that the post parameter is sent, but when i print the response from the php file, it is blank.</p>
  
  <p>I tried this code:</p>
  
  <p>controller.js</p>
  
  <pre><code>$http.post("someurl", {data: {"data333": 'peter'}});
  </code></pre>
  
  <p>When I print <code>$_POST</code> or <code>$_REQUEST</code> from php, it is a blank array, but from my console I can see that parameters are passed with the json <code>{data: {"data333": 'peter'}}</code>.</p>
  
  <p>I have allowed cross domain in both client and server.</p>
  
  <p>I also tried the standard ajax way:</p>
  
  <pre><code>$http.defaults.headers.post["Content-Type"] = 'application/x-www-form-urlencoded; charset=UTF-8';
  $http({
          method : 'POST',
          url : 'someurl/',
          headers: {
              'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8'
          }, 
  data : {"key": "value"}
  })
  </code></pre>
  
  <p>Can anyone help me pass the data?</p>