reneknox / fetch
curl请求包装器
dev-master
2023-01-12 13:15 UTC
Requires
- php: >=7.4
- ext-curl: *
- ext-json: *
Requires (Dev)
- phpunit/phpunit: 9.5.20
This package is auto-updated.
Last update: 2024-09-12 17:20:27 UTC
README
curl请求示例包装
安装与依赖
- php 单元测试
运行测试
composer test
使用方法
$httpRequest = new HttpRequest(); $response = $httpRequest->set_base_url('https://jsonplaceholder.typicode.com') ->set_headers(['Content-Type' => 'application/json']) ->get('/todos'); // or $httpRequest = new HttpRequest(); $httpRequest->set_base_url('https://jsonplaceholder.typicode.com'); $httpRequest->set_headers(['Content-Type' => 'application/json']); $response = $httpRequest->get('/todos');
目录结构
|—— .gitignore
|—— src
|—— composer.json
|—— composer.lock
|—— developer
|—— LICENSE
|—— phpunit.xml
|—— tests
| |—— Uint
|—— vendor
测试平台
-
软件
OS: Ubuntu - Windows 10
许可
MIT