freyo/qcloud-apigateway-http

1.2.0 2019-08-09 08:41 UTC

README

68747470733a2f2f6d632e71636c6f7564696d672e636f6d2f7374617469632f696d672f66313666316163386536303732336665633536363735656563326137346631622f696d6167652e737667

Tencent Cloud API Gateway PHP SDK

Software License Quality Score Packagist Version Total Downloads

FOSSA Status

Requirement

  1. PHP >= 7.1.3
  2. Composer
  3. openssl 拓展

Installation

$ composer require freyo/qcloud-apigateway-http -vvv

Usage

<?php

include 'vendor/autoload.php';

use Freyo\ApiGateway\Application;

$app = new Application([
    'response_type' => 'collection',
    'secret_key'    => 'your-secret-key',
    'secret_id'     => 'your-secret-id',
    'region'        => 'your-gateway-region', // e.g., ap-guangzhou
    'log'           => [
        'file'  => __DIR__ . DIRECTORY_SEPARATOR . 'apigateway.log',
        'level' => 'debug',
    ],
    'http' => [
        'base_uri' => 'http://{service-id}.{region}.apigw.tencentcs.com',
        // 'base_uri' => 'http://{service-id}.{region}.apigateway.myqcloud.com',
    ],
]);

$response = $app->base_client->request('path/to');

var_dump($response);

License

The MIT License (MIT). Please see License File for more information.

FOSSA Status