PHP code example of nkf / example-api-client

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

    

nkf / example-api-client example snippets


use GuzzleHttp\Client;
use GuzzleHttp\Psr7\HttpFactory;
use ExampleApi\Config;
use ExampleApi\Clients\CommentClient;

$config = new Config('http://example.com/'); // Можно изменить если используется проксирующий домен

$client = new CommentClient(
  new Client(),
  $config,
  new HttpFactory(),
);

$comments = $client->getAll(); // Получаем все комментарии