alextartan/guzzle-psr18-adapter 问题修复 & 功能扩展

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

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

alextartan/guzzle-psr18-adapter

最新稳定版本:4.0.4

Composer 安装命令:

composer require alextartan/guzzle-psr18-adapter

包简介

Lightweight wrapper over Guzzle to comply with PSR18

README 文档

README

Guzzle Adapter for PSR-18

Wrapper over Guzzle to comply with PSR-18

Current build status

CI codecov Infection MSI Downloads

Install

The easiest way is to use composer:

composer require alextartan/guzzle-psr18-adapter

Note: requires PHP >= 7.2

Usage

Example:

<?php

use Psr\Http\Client\ClientInterface;
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Client\NetworkExceptionInterface;
use Psr\Http\Client\RequestExceptionInterface;
use GuzzleHttp\Psr7\Request;

[...]

public function sendSomething(ClientInterface $client, $data)
{
    // Using GuzzleHttp\Psr7\Request in this example, but any implementation of PSR-7 will do
    $request = new Request('GET', 'https://some-domain.com/something');
    try{
        // response is also an implementation of PSR-7 (Psr\Http\Message\ResponseInterface)
        $response = $client->sendRequest($request)
    } catch(ClientException $e){
        // do something
    } catch(NetworkException $e){
        // do something
    } catch(RequestException $e){
        // do something
    }
}

[...]

Issues and pull requests.

Any issues found should be reported in this repository issue tracker, issues will be fixed when possible. Pull requests will be accepted, but please adhere to the PSR2 coding standard. All builds must pass in order to merge the PR.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固