balpom/guzzle-downloader
最新稳定版本:v1.1.1
Composer 安装命令:
composer require balpom/guzzle-downloader
包简介
Downloads the contents of the specified URI (or file).
关键字:
README 文档
README
Simple realisation of Balpom\UniversalDownloader\PSR18DownloadInterface based on Guzzle PHP HTTP client.
This downloader is a simple realisation of PSR18DownloadInterface from balpom/universal-downloader, based on Guzzle PHP HTTP client (guzzle/guzzle; see more information on https://guzzlephp.org).
Requirements
- PHP >= 8.1
Installation
Using composer (recommended)
composer require balpom/guzzle-downloader
Guzzle downloader usage sample
$downloader = new \Balpom\GuzzleDownloader\Downloader(); $downloader = $downloader->get('https://ipmy.ru/ip'); $result = $downloader->result(); echo $result ->code() . PHP_EOL; // Must be 200. echo $result ->content() . PHP_EOL; // Must be your IP. echo $result ->mime() . PHP_EOL; // Must be "text/html".
Method "response()" return PSR7 Response (Psr\Http\Message\RequestInterface: https://www.php-fig.org/psr/psr-7/).
print_r($result->response());
Opportunities for extension
Protected method "downloader()" return Balpom\UniversalDownloader\Downloader, which created into constructor of Downloader.php. And protected method client() return GuzzleHttp\Client (which also created into constructor of Downloader.php).
License
MIT License See LICENSE.MD
统计信息
- 总下载量: 22
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-22