1. Go to this page and download the library: Download katanyoo/yii2-app-api 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/ */
katanyoo / yii2-app-api example snippets
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is
// Result is html text
$text = Yii::$app->httpclient->get('http://httpbin.org/html');
// Result is SimpleXMLElement containing parsed XML
$xml = Yii::$app->httpclient->get('http://httpbin.org/xml');
// Result is parsed JSON array
$json = Yii::$app->httpclient->get('http://httpbin.org/get');
// Result is Guzzle `Response` object
$text = Yii::$app->httpclient->get('http://httpbin.org/xml', [], false);