amirasaran/yii2-curl
Composer 安装命令:
composer require amirasaran/yii2-curl
包简介
Create Rest Request (POST,GET,PUT,DELETE,...)
关键字:
README 文档
README
Create Rest Request (POST,GET,PUT,DELETE,...)
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require amirasaran/yii2-curl:dev-master
or add
"amirasaran/yii2-curl": "dev-master"
to the require section of your composer.json file.
Configure
Add the following code to your common/config/main.php components
'components' => [ ... 'curl' => [ 'class' => 'amirasaran\yii2curl\Curl', 'connectionTimeout' => 100, 'dataTimeout' => 100, ], ... ]
Usage
$url = 'http://jsonplaceholder.typicode.com/posts'; /** @var \amirasaran\yii2curl\Curl $curl */ $curl = Yii::$app->curl; $res = $curl->get($url,[],false); echo '<pre>'; print_r($res);exit;
统计信息
- 总下载量: 4.67k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2016-01-31