PHP と cURL を使用して eBay のショッピング API を呼び出し、応答を JSON 形式で返そうとしています。URLをブラウザに直接入力すると機能しますが、PHP内では機能しません。XML を扱いたくありません。JSON の方が簡単です。助言がありますか?
$Url ="http://open.api.ebay.com/shopping?callname=GetMultipleItems&responseencoding=JSON&appid=MyAppId&siteid=0&version=525&ItemID=290585620456,290683575886&IncludeSelector=Details,ShippingCosts,Variations";
//check if you have curl loaded
if(!function_exists("curl_init")) die("cURL extension is not installed");
$ch=curl_init($Url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$r=curl_exec($ch);
curl_close($ch);
var_dump($r);