ocolin/tarana
最新稳定版本:2.2
Composer 安装命令:
composer require ocolin/tarana
包简介
Basic REST client for Tarana general API
README 文档
README
Description
This is a basic client for the Tarana API. It uses the EasySwagger library, but contains the Tarana swagger JSON file.
Usage
Environment variables
You can specify parameters in the constructor, but if any are left out, these environment variables will be used instead.
TARANA_API_TOKEN - Authentication token for API
TARANA_HOST - URL of server API
Instantiate
Create an instance of the Tarana object.
$tarana = new Ocolin\Tarana\Client();
Parameters
$url: Name of the Tarana host server. If null, will use .env field.
$api_key: Authentication token for server. If null, will use .env field.
$timeout: HTTP timeout. Defaults to 20 seconds.
$verify: Verify SSL credentials. Defaults to off.
Making a call
$output = $tarana->call( path: '/v1/network/regions', query: [ 'count' => '10' ] );
Parameters
$path: REQUIRED - End point API path, including named parameters names which will be replaced by variables. Copy/paste from the API docs.
$query: Array of parameters name/values to use for URI path or query URI.
$method: HTTP method. Defaults to GET.
$body: Object or array for POST/PUT/PATCH HTTP request bodies.
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-30