PHP code example of ivalrivall / lazop-php-sdk

1. Go to this page and download the library: Download ivalrivall/lazop-php-sdk 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/ */

    

ivalrivall / lazop-php-sdk example snippets


// upload file

    t('https://api.lazada.test/rest', '${appKey}', '${appSecret}');
    $request = new LazopRequest('/xiaoxuan/mockfileupload');
    $request->addApiParam('file_name','pom.xml');
    $request->addFileParam('file_bytes',file_get_contents('/Users/xt/Documents/work/tasp/tasp/pom.xml'));

    var_dump($c->execute($request));

// simple request

    https://api.lazada.test/rest', '${appKey}', '${appSecret}');
    $request = new LazopRequest('/mock/api/get');
    $request->addApiParam('api_id',1);
    $request->addHttpHeaderParam('cx','test');
    
    var_dump($c->execute($request));