kobas/api-client
最新稳定版本:2.4
Composer 安装命令:
composer require kobas/api-client
包简介
README 文档
README
Signs API requests and allows interaction via cURL methods.
Example
/** * Setup */ $companyId = 0000;// company id provided by Kobas $clientId = '';// client id provided by Kobas $clientSecret = '';// client secret provided by Kobas $clientScope = ''; // client scope provided by Kobas $provider = new \Kobas\APIClient\Auth\Provider($companyId, $clientId, $clientSecret, $clientScope); $client = new \Kobas\APIClient\Client($provider); /** * Usage */ $response = $client->get('customer/search', ['email' => 'example@example.com']); echo json_encode($response, JSON_PRETTY_PRINT);
Client Functions
get($route, $params = array(), $headers = array())
Sends a HTTP GET Request to the route provided.
post($route, $params = array(), $headers = array())
Sends a HTTP POST Request to the route provided.
put($route, $params = array(), $headers = array())
Sends a HTTP PUT Request to the route provided.
delete($route, $params = array(), $headers = array())
Sends a HTTP DELETE Request to the route provided.
getRequestInfo()
Returns the result of curl_getinfo()on the last request made as an array.
setAPIBaseURL($url)
Allows over-riding the base URL (only really needed for development)
setAPIVersion($version)
Allows over-riding of the API version. Might be useful in future?
统计信息
- 总下载量: 1.23k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-10-09