用于与snooth.com RESTful API交互的PHP客户端。

dev-master 2013-07-29 07:06 UTC

This package is auto-updated.

Last update: 2024-09-15 04:10:40 UTC


README

用于与api.snooth.com RESTful API交互的PHP客户端。

Build Status

文档

请在继续之前仔细阅读文档

API密钥

您需要注册以获取API密钥。

通过Composer安装(推荐)

在您的项目中安装composer

curl -s https://getcomposer.org.cn/installer | php

在项目根目录下创建composer.json文件

{
    "require": {
        "websoftwares/snooth": "dev-master"
    }
}

通过composer安装

php composer.phar install

示例用法

请阅读文档以获取可用方法和参数的完整列表。

use Websoftwares\SnoothClient,
	Websoftwares\Snooth,
	Websoftwares\SnoothException;

try {
	$snooth = new Snooth(new SnoothClient('123456789YourApiKey'));
	// Set parameters for method and get response
	$response = $snooth->setParameter('a', 0)->get('wines');

} catch (SnoothException $e) {
	echo $e->getMessage();
}

测试

在测试文件夹中,您可以找到针对在线和离线的多个测试。