mobtexting / php-http-client
此包已被废弃且不再维护。未建议替代包。
HTTP REST客户端,简化PHP使用
v1.0
2018-05-08 05:16 UTC
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: ~4.4
- squizlabs/php_codesniffer: ~2.0
This package is auto-updated.
Last update: 2023-08-29 01:50:52 UTC
README
安装
您可以通过composer安装此包
composer require mobtexting/php-http-client
使用方法
$token = 'xxxx'; $headers = ['Authorization: Bearer ' . $token]; $client = new Mobtexting\Client('https://api.example.com', $headers); $data = [ 'some' => 1, 'awesome' => 2, 'data' => 3 ]; $queryParams = [ 'hello' => 0, 'world' => 1 ]; $requestHeaders = [ 'X-Test' => 'test' ]; $response = $client->post($data, $queryParams, $requestHeaders); var_dump( $response->statusCode(), $response->headers(), $response->body() );
安全
如果您发现任何安全相关问题,请通过电子邮件support@mobtexting.com联系,而不是使用问题跟踪器。
贡献
有关详细信息,请参阅CONTRIBUTING。
许可
MIT许可证(MIT)。有关更多信息,请参阅许可文件。