spn4 / zttp
一个以开发者体验为重点的HTTP客户端,针对最常见的使用场景进行了优化。
v1.0.1
2021-09-26 14:24 UTC
Requires
- php: >=7.0|^8.0
- guzzlehttp/guzzle: ^7.2
- tightenco/collect: ^5.4
Requires (Dev)
- phpunit/phpunit: ^9.0
README
Zttp是一个简单的Guzzle包装器,旨在为大多数常见使用场景提供愉悦的开发体验。
如果您需要更多功能,只需使用Guzzle :)
真实文档正在制作中,但到目前为止,请阅读测试。
$response = Zttp::withHeaders(['Fancy' => 'Pants'])->post($url, [
'foo' => 'bar',
'baz' => 'qux',
]);
$response->status();
// int
$response->isOk();
// true / false
$response->json();
// => [
// 'whatever' => 'was returned',
// ];
安装
composer require spondonit/zttp