windsor/master-client

此包的最新版本(dev-master)没有可用的许可证信息。

与主Windsor电信API交互的HTTP客户端

此包的规范存储库似乎已消失,因此该包已被冻结。

dev-master 2019-08-01 14:05 UTC

This package is auto-updated.

Last update: 2023-03-21 19:10:29 UTC


README

目前处于alpha阶段,请勿在生产环境中使用

用法

<?php

$guzzle = new GuzzleHttp\Client([
    'base_uri' => '' // set me
]);

$client = new Windsor\Master\Client($guzzle);
$client->authenticate(''); // set me

try {
    $response = $client->get('contracts');
    $data = json_decode($response, true);
    
    foreach ($data['data'] as $contracts) {
        // do something
    }
} catch (Windsor\Master\Exception $e) {
    echo $e->getMessage()."\n";

    if ($e->getType() == 'unknown') {
        echo 'Request ref: '.$e->getRef()."\n";
    }
}