Посылаю запрос
var url="data?preset=sources_search_phrases"
$.ajax({
url:"stat/metrika.php",
data:"url="+url,
dataType: "json",
success: function(json){
alert(json.query.ids)
},
Обработка на сервере
if( $curl = curl_init() ) {
curl_setopt($curl, CURLOPT_URL, "https://api-metrika.yandex.ru/stat/v1/".$url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, "id=".$id."&oauth_token=".$token."");
$out = curl_exec($curl);
echo $out;
curl_close($curl);
}
Пишет Uncaught TypeError: Cannot read property 'ids' of undefined если просто вывести json пишет Request method 'POST' not supported
На предыдущей версии api yandex все работало,тут нет, это точно правильно json.query.ids видимо косяк в формировании url для запроса