g4/gateway

gateway PHP 库

3.2.0 2024-02-20 09:13 UTC

README

gateway - PHP

安装

通过 Composer

composer require g4/gateway

用法

use G4\Gateway\Options;
use G4\Gateway\Http;

$options = new Options();
$options
    ->addHeader('Accept', 'application/json')   // optional
    ->setTimeout(30)                            // optional
    ->setSslVerifyPeer(true);                   // optional
    
$http = new Http('http://api.url', $options)
$http
    ->setServiceName('maps');                   // optional

$response = $http->get(['id' => 123]);          // post(), put(), delete()

echo $response->getCode();
echo $response->getBody();

开发

安装依赖项

$ make install

运行测试

$ make unit-tests

许可证

(MIT 许可证) 详细信息请参阅 LICENSE 文件...