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