piotrpress / remoter
此库是一个基于 file_get_contents() 函数的可链式 HTTP 客户端。
v1.0.0
2022-05-06 13:48 UTC
Requires
- php: >=7.4
This package is not auto-updated.
Last update: 2024-09-24 23:54:45 UTC
README
此库是一个基于 file_get_contents() 函数的可链式 HTTP 客户端。
安装
$ composer require piotrpress/remoter
示例
require __DIR__ . '/vendor/autoload.php'; use PiotrPress\Remoter\Request; use PiotrPress\Remoter\Url; use PiotrPress\Remoter\Header; echo ( ( new Request( ( new Url( 'https://api.github.com' ) )->setPath( '/repos/PiotrPress/remoter' ), 'GET', ( new Header( [ 'User-Agent' => 'PiotrPress/Remoter' ], true ) )->set( 'Accept', 'application/vnd.github.v3+json' ) ) )->send() )->getHeader()->get( 'code' );
要求
PHP >= 7.4
版本。