ovvio/http-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ovvio/http-client

最新稳定版本:v1.0.0

Composer 安装命令:

composer require ovvio/http-client

包简介

Provides powerful methods to fetch HTTP resources synchronously or asynchronously

关键字:

README 文档

README

Provides powerful methods to fetch HTTP resources synchronously or asynchronously

Technical Requirements & Installation

PHP 8.4 - Installation and Configuration

Composer (System Requirements)

To install run this:

composer require ovvio/http-client

Example

...

use Ovvio\Component\Http\HttpClient\HttpClientInterface;
use Ovvio\Component\Http\HttpClient\Request\Enum\RequestMethod;
use Ovvio\Component\Http\HttpClient\Response\Enum\ResponseStatusCode;

...

    public function __construct(
        private readonly HttpClientInterface $httpClient,
    ) {
    }

...

    public function foo(FooDtoInterface $fooDto): void
    {

        ...

        /** @var string $url URL */
        $url = 'https://ovvio.pro';
        $requestMethod = RequestMethod::GET;

        $request = RequestFactory::create(
            url: $url,
            method: $requestMethod,
        );

        $response = $this->httpClient->request($request);
        if ($response->getStatusCode() !== ResponseStatusCode::HTTP_OK) {
            // do something
        }

        ...

    }

...

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2024-12-18