kfosoft/php-restful-client
最新稳定版本:1.0
Composer 安装命令:
composer require kfosoft/php-restful-client
包简介
PHP RESTful Client
关键字:
README 文档
README
Installation
Installation with Composer
Either run
php composer.phar require --prefer-dist kfosoft/rest-client:"*"
or add in composer.json
"require": {
...
"kfosoft/php-restful-client":"*"
}
Well done!
Example call GET
$result = (new RestClient())->requestParams(RestClient::GET, $url, $data)->call();
Example call CUSTOM with GET data
$result = (new RestClient())->requestParams(RestClient::CUSTOM, $url, $data)->call();
Example call CUSTOM with POST data
$result = (new RestClient())->requestParams(RestClient::CUSTOM, $url, $data)->usePost()->call();
Example call to url with http auth
$result = (new RestClient())->requestParams(RestClient::POST, $url, $data)->useHttpAuth($username, $password)->call();
Use response content type
$result = (new RestClient())->requestParams(RestClient::PATCH, $url, $data)->useResponseContentType()->call();
Get result in stdClass
$result = (new RestClient())->requestParams(RestClient::PUT, $url, $data)->usePost()->call(true);
Enjoy, guys!
统计信息
- 总下载量: 362
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-09-09