PHP code example of arikin / api_client
1. Go to this page and download the library: Download arikin/api_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/ */
arikin / api_client example snippets
use Arikin\ApiClient;
$client = new ApiClient(array(
'url' => 'http://api.server.net',
'user' => 'api_username',
'pass' => 'secret_password'
));
$resp_obj = $client->api->get('/user/list');
$code = $resp_obj->getStatusCode();
$reason = $resp_obj->getReasonPhrase();
$body_string = (string) $resp_obj->getBody();
$data_array = json_decode($body_string,TRUE);
bash
php composer.phar