public function ImegeGet($token) {
$headers = array("Authorization: OAuth ".$token."");
$curl = curl_init('https://cloud-api.yandex.net/v1/disk/resources/last-uploaded?media_type=image');
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($curl,CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_exec($curl);
$imeg = curl_getinfo($curl);
return $imeg;
}
public function testAction() {
$Yandex = new application\lib\Yandex;
var_dump($Yandex->ImegeGet($_SESSION['token']));
}
получается ответ:
array(26) {
["url"]=>
string(77) "https://cloud-api.yandex.net/v1/disk/resources/last-uploaded?media_type=image"
["content_type"]=>
string(16) "application/json"
["http_code"]=>
int(405)
["header_size"]=>
int(449)
["request_size"]=>
int(327)
["filetime"]=>
int(-1)
["ssl_verify_result"]=>
int(0)
["redirect_count"]=>
int(0)
["total_time"]=>
float(0.359)
["namelookup_time"]=>
float(0.062)
["connect_time"]=>
float(0.109)
["pretransfer_time"]=>
float(0.296)
["size_upload"]=>
float(0)
["size_download"]=>
float(126)
["speed_download"]=>
float(350)
["speed_upload"]=>
float(0)
["download_content_length"]=>
float(126)
["upload_content_length"]=>
float(-1)
["starttransfer_time"]=>
float(0.359)
["redirect_time"]=>
float(0)
["redirect_url"]=>
string(0) ""
["primary_ip"]=>
string(15) "213.180.204.127"
["certinfo"]=>
array(0) {
}
["primary_port"]=>
int(443)
["local_ip"]=>
string(14) "192.168.43.118"
["local_port"]=>
int(1683)
}
что не так?