1. Go to this page and download the library: Download rvasiliy/http_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/ */
rvasiliy / http_client example snippets
$config = [
// базовый url, который будет добавлен как префикс к другим
'baseUrl' => '',
'serializer' => [
'class' => 'rvasiliy\\http_client\\serializer\\StringSerializer',
],
];
$config = [
// базовый url, который будет добавлен как префикс к другим
'baseUrl' => '',
'serializer' => [
'class' => 'rvasiliy\\http_client\\serializer\\JsonSerializer',
'property' => [
// true - данные в виде массива
// false - данные в виде объекта
'asArray' => true,
],
],
];