lihq1403/simple-client

Simple Client.

1.0.1 2023-12-26 03:38 UTC

This package is auto-updated.

Last update: 2024-04-26 04:24:00 UTC


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