weixin_33725272 2015-05-14 10:58 采纳率: 0%
浏览 21

AJAX_CURL错误请求400

I am using SMS API :

  1. Through HTTP URL its working fine URL sample is:

http://testxyz.com?user=xyz&password=xyz&mob=xyz&sid=xyz&msg=xyz

  1. 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.

  • 写回答

0条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 Android URL如何转成视频/音频,可行吗?
      • ¥20 SQL数据查询,子查询
      • ¥15 c++字符串分割问题
      • ¥15 关于#sql#的问题:没有用命令关闭cdc,手动把系统表开启的cdc右键删除了
      • ¥15 vue+uniapp
      • ¥15 android freedom
      • ¥15 使用自定义的类型代替内置类型可行吗
      • ¥15 关于STM32的SPI和ENDAT接口编码器通信的问题
      • ¥15 关于#pdfbox#生成的PDF文件正常,转图片中文乱码的问题,如何解决?
      • ¥15 ADS中有关DAC控件的使用问题