I am using SMS API :
- Through HTTP URL its working fine URL sample is:
http://testxyz.com?user=xyz&password=xyz&mob=xyz&sid=xyz&msg=xyz
- Through CURL curl_init($url); Its also working fine
But when I am using AJAX and call the CURL 2nd option its showing me Bad Request 400
AJAX Code
var dataString = "mobile="+mobile+"&sentSMS="+sentSMS;
$.ajax({
type: "POST",
url: "getMessage.php",
data: dataString,
async:false,
beforeSend:
function(){
$("#msg_result").html("Please wait.....");
},
success: function(msg){
$("#msg_result").html("Sent...");
},
}); }
getMessage.php
$ch = curl_init("http://testxyz.com?user=xyz&password=xyz&mob=xyz&sid=xyz&msg=xyz");
curl_exec($ch);
curl_close($ch);
Any suggestion please.
Thanks In advance.