0
curl reques를 사용하여 sms에 대한 보고서를 얻지 만 몇 가지 문제가 있습니다. 나는 또한 URL을 인코딩하여 ckecked했지만 여전히 같은 문제. 400 개의 잘못된 요청이 표시됩니다.HTTP 오류 400입니다. 요청이 잘못되었습니다. curl 요청시
$url="http://api.smscountry.com/smscwebservices_bulk_reports.aspx?user=&passwd=&fromdate=19/04/2017 00:00:00&todate=19/04/2017 23:59:59&jobno=60210892"; //callbackURL=http://www.jouple.com/marketing/public/save/sms
$ch = curl_init();
if (!$ch){
die("Couldn't initialize a cURL handle");
}
$ret = curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
// curl_setopt ($ch, CURLOPT_POSTFIELDS,
// "User=$user&passwd=$password&sid=$senderid");
// $ret = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//If you are behind proxy then please uncomment below line and provide your proxy ip with port.
// $ret = curl_setopt($ch, CURLOPT_PROXY, "PROXY IP ADDRESS:PORT");
$curlresponse = curl_exec($ch); // execute
// print_r($ch);die;
if(curl_errno($ch))
echo 'curl error : '. curl_error($ch);
if (empty($ret)) {
// some kind of an error happened
die(curl_error($ch));
curl_close($ch); // close cURL handler
} else {
$info = curl_getinfo($ch);
curl_close($ch); // close cURL handler
}
Thanks Devinder Kumar, 내가 말한대로 코드를 변경했지만 지금은이 오류를 제공합니다. " '/'응용 프로그램의 서버 오류." –
이 부분을 참조하십시오. http://stackoverflow.com/questions/28888267/server-error-in-application-when-attempting-to-curl#answer-28907180 –