PHP code example of sancho2804 / rest_client

1. Go to this page and download the library: Download sancho2804/rest_client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sancho2804 / rest_client example snippets


use sancho2804\rest_client\main;
$yandex_disk=new main('https://cloud-api.yandex.net:443/v1/','OAuth',$token);

$yandex_disk->set_service('yandex_disk');

$yandex_disk->exec('dir_info',null,'/');

$result=$yandex_disk->dir_info(null, '/');
//Идентично $yandex_disk->exec('dir_info',null,'/');

$yandex_disk->get('disk/resources?path=/');

$yandex_disk->save('disk/resources/copy?from=/file1.php&path=/file2.php');

$yandex_disk->delete('disk/resources?path=/file2.php');

$yandex_disk->update('disk/resources?path=/file2.php&body=...');

$yandex_disk->create('disk/resources/publish?path=/file2.php');

//Пока не встречал его в работе, но он как суслик