lihq1403 / simple-client
Simple Client.
Installs: 7 831
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.4
- ext-json: *
- adbario/php-dot-notation: ^3.0|^2.0
- guzzlehttp/guzzle: ^6.0|^7.0
- pimple/pimple: ^3.0
- psr/log: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- mockery/mockery: ^1.0
- phpunit/phpunit: >=7.0
README
简易请求封装
Installing
$ composer require lihq1403/simple-client -vvv
Usage
$config = [ 'host' => 'https://restapi.amap.com', 'sdk_name' => 'xxx', 'sdk_version' => '1.0.1', 'component' => [ 'logger' => null, // 日志组件 'client' => null, // guzzle客户端 ], ]; $app = new Application($config); $simpleClient = new SimpleClient($app); $actualResponse = $simpleClient->get('/v3/weather/weatherInfo', [ 'query' => [ 'key' => 'mock-key', 'city' => '深圳', 'output' => 'json', 'extensions' => 'base', ], ]);
License
MIT