byjg/webrequest 问题修复 & 功能扩展

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

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

byjg/webrequest

最新稳定版本:6.0.0

Composer 安装命令:

composer require byjg/webrequest

包简介

A lightweight PSR-7 implementation and highly customized CURL wrapper for making REST calls.

README 文档

README

Sponsor Build Status Opensource ByJG GitHub source GitHub license GitHub release

A lightweight PSR-7 implementation and highly customized CURL wrapper for making REST calls.

Overview

PHP WebRequest is a fully PSR-compliant HTTP client package that provides:

PSR Implementations

  • PSR-7 - HTTP Message Interface (Request, Response, Stream)
  • PSR-17 - HTTP Factories (Request, Response, Stream, etc.)
  • PSR-18 - HTTP Client Interface

Additional Features

  • Helper classes for common request types (JSON, Form URL Encoded, MultiPart)
  • Support for parallel HTTP requests
  • Mock client for testing

Documentation

Basic Example

<?php
// Create a request
$uri = \ByJG\Util\Uri::getInstanceFromString('http://www.example.com/page');
$request = \ByJG\WebRequest\Psr7\Request::getInstance($uri);

// Send the request
$response = \ByJG\WebRequest\HttpClient::getInstance()->sendRequest($request);

// Process the response
$statusCode = $response->getStatusCode();
$body = $response->getBody()->getContents();

Install

composer require "byjg/webrequest"

Running Tests

# Start the test server
docker-compose up -d

# Run the tests
vendor/bin/phpunit

# Stop the server
docker-compose down

Dependencies

flowchart TD
    byjg/webrequest --> psr/http-message
    byjg/webrequest --> psr/http-client
    byjg/webrequest --> ext-json
    byjg/webrequest --> byjg/uri
Loading

Open source ByJG

统计信息

  • 总下载量: 476.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 10
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-14