rdx/http
Composer 安装命令:
composer require rdx/http
包简介
A simple HTTP wrapper around CURL, with request and response classes.
README 文档
README
Super simple, very imcomplete, very small wrapper around CURL.
If you need decent cookie handling, use Guzzle etc.
Request
GET
use rdx\http\HTTP;
$request = HTTP::create('https://api.github.com/gists/public');
$response = $request->request();
POST
use rdx\http\HTTP;
HTTP::$_agent = 'Some custom user agent string 1.0';
$request = HTTP::create('https://api.github.com/gists/public', array(
'method' => 'POST',
'data' => array('foo' => 'bar'),
'headers' => array(
'Authorization: Basic abc',
),
'cookies' => array(
array('name', 'value'),
),
));
$response = $request->request();
Response
var_dump($response->code); // 200
var_dump($response->status); // OK
print_r($response->cookies_by_name);
统计信息
- 总下载量: 81
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-01-10