PHP code example of jacklin / request-box-sdk-v2

1. Go to this page and download the library: Download jacklin/request-box-sdk-v2 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/ */

    

jacklin / request-box-sdk-v2 example snippets


define('ROOT_PATH',__DIR__.'');

 = new Major('xxxxx','xxxx','http://gateway.dev.7723.com/index.php');


echo "<pre>";
// get使用方法一
// var_dump($r->app__i('get',['id'=>1,'fields' =>'*'],['version'=>'3.0.0']));
// get使用方法二
// $r->setDefaultJsonDecoder(true);
// var_dump($r->app__i('get',['id'=>1,'fields' =>'*']));
// get使用方法三
// var_dump($r->setDefaultJsonDecoder(true)->app__i('get',['id'=>1,'fields' =>'*']));

// post使用方法一
// var_dump($r->app__a('post',['app_id' => '7723cn_android_phone_1S2','iv'=>'0123456789012345']));
// post使用方法二
// $r->setDefaultJsonDecoder(true);
// var_dump($r->app__a('post',['app_id' => '7723cn_android_phone_1S2','iv'=>'0123456789012345']));
// post使用方法三
// var_dump($r->setDefaultJsonDecoder(true)->app__a('post',['app_id' => '7723cn_android_phone_1S2','iv'=>'0123456789012345']));

/**
 * 注:
 * 接口调用方法参数分别:string请求类型[get|post],array请求内容[必选],array请求头[可选]
 */