dominikangerer/php-easy-client

DominikAngerer - 简单获取和缓存数据的客户端

v1.0.3 2017-02-15 10:19 UTC

This package is not auto-updated.

Last update: 2024-09-23 15:30:50 UTC


README

允许使用Guzzle结合APIX进行缓存从GET和POST请求

安装

composer require dominikangerer/php-easy-client

如何使用

// initialize with domain
$client = new \DominikAngerer\Client('https://raw.githubusercontent.com');

// Optionally set a cache
$client->setCache('filesytem', array('path' => 'cache'));

// execute a get Request and get the Body
$client->get('/DominikAngerer/default-datasources/master/country-iso2.json', array('time' => time()));
$data = $client->getBody();

// access the headers
$headers = $client->getHeaders();