PHP code example of hussainweb / drupal-api-client

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

    

hussainweb / drupal-api-client example snippets


use Http\Adapter\Guzzle6\Client as GuzzleAdapter;
use Hussainweb\DrupalApi\Client;
use Hussainweb\DrupalApi\Request\UserRequest;

$config = [
    'timeout' => 2,
    // 'handler' => ...
    // ...
];
$adapter = GuzzleAdapter::createWithConfig($config);

// Retrieve user with uid 314031.
$client = new Client($adapter);
$user_request = new UserRequest('314031');
$user = $client->getEntity($user_request);