Для Кечи

by Denis Tverdokhlebov

HTML

$auth = base64_encode('login:Pass');
$opts = array(
    'http' => array(
        'request_fulluri' => true,
        'method' => "GET",
        'header' => "Accept-language: en\r\n" .
        "Cookie: foo=bar\r\n" .
        "Proxy-Authorization: Basic $auth"
    )
);

$context = stream_context_create($opts);

// Открываем файл с помощью установленных выше HTTP-заголовков
$file = file_get_contents('http://api.data.mos.ru/v1/datasets/1542/rows?$top=1', false, $context);
print_r(json_decode($file, true));
$array_in = json_decode($file, true);