trulyao/neat-http
最新稳定版本:1.0.0
Composer 安装命令:
composer require trulyao/neat-http
包简介
An HTTP client/wrapper based on curL
README 文档
README
EXPERIMENTAL
A curL-based HTTP client. This is an experimental side-project, if you need something more robust and stable, you can check out GuzzleHTTP. Feel free to fork or make a PR too :)
Requirements
- PHP 8.0+
- CurL extension (ENABLE IN
PHP.INI)
Installation
composer require trulyao/neat-http
Usage
<?php use Trulyao\NeatHttp\Client; $client = new Client( [ 'baseUrl' => 'http://example.com', 'object' => true, // return object instead of array 'headers' => [ 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], ] // optional base config ); $variable1 = $client->get('1'); $variable2 = $client->post('', [ 'data' => [ 'title' => 'foo', 'body' => 'bar', 'userId' => 1, ], ]); // automatically serialized to JSON before sending
Check
__tests__for more usage example.
统计信息
- 总下载量: 54
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-09-01