I am building iOS app in Phonegap and trying to do an ajax POST call to remote server. Server gets the call. It responds fine, but the server doesn't seem to get any of the POST data.
Ajax call is as follows :
var formData = $(this).serialize();
$.ajax({
type:'post',
url:'https://www.mySite.com/ajax/test',
data: formData,
dataType: "json",
crossDomain:true,
async: true,
success: function (result) {
alert(result.success)
},
error: function (request,error) {
alert('error');
}
});
On the server (for testing purposes), I'm just bringing it back
$json = array('success' => 'true'.serialize($_POST));
I print the $_POST
variable on the server. Whenever the iPhone gets the callback, all the POST data is missing. The variable formData
definitely has the information. I'm confused whether it actually sends it or the server strips it away.
Any help is greatly appreciated.