PHP code example of alibabacloud / viapi-utils

1. Go to this page and download the library: Download alibabacloud/viapi-utils 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/ */

    

alibabacloud / viapi-utils example snippets



namespace demo;

ViapiUtils\ViapiUtils;
use AlibabaCloud\Tea\Exception\TeaUnableRetryError;

try {
    $url = ViapiUtils::upload("<Access-Key-Id>", "<Access-Key-Secret>", "<File-Path>");
    var_dump($url);
} catch (TeaUnableRetryError $e) {
    var_dump($e->getMessage());
    var_dump($e->getErrorInfo());
    var_dump($e->getLastException());
    var_dump($e->getLastRequest());
}