1. Go to this page and download the library: Download jaeger/g-http 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/ */
use Jaeger\GHttp;
use Symfony\Component\Cache\Adapter\RedisAdapter;
$cache = new RedisAdapter(
// the object that stores a valid connection to your Redis system
$redis = RedisAdapter::createConnection(
'redis://localhost'
),
// the string prefixed to the keys of the items stored in this cache
$namespace = 'cache',
// the default lifetime (in seconds) for cache items that do not define their
// own lifetime, with a value 0 causing items to be stored indefinitely (i.e.
// until RedisAdapter::clear() is invoked or the server(s) are purged)
$defaultLifetime = 0
);
$rt = GHttp::get('http://httpbin.org/get',[
'wd' => 'QueryList'
],[
'cache' => $cache,
'cache_ttl' => 120
]);
print_r($rt);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.