PHP code example of lihq1403 / simple-client

1. Go to this page and download the library: Download lihq1403/simple-client 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/ */

    

lihq1403 / simple-client example snippets


$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',
    ],
]);