Hello every once
I want to send post request to remote php file from ionic app to save base64 encoded data in the database, but when i pass post data i can see the post parameter is sent but when i print post response from php file its blank
I have added the sample code i tried
cotroller.js
$http.post("someurl", {data: {"data333": 'peter'}});
in php file when i print $_POST
or $_REQUEST
its blank array but from my console i can see parameters are passed and its json format {data: {“data333”: ‘peter’}}
i have allowed cross domain in both client and server
i also tried the standard ajax way also
$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”}
})
can anyone help me to pass this data