承接 http-php/messages 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

http-php/messages

Composer 安装命令:

composer require http-php/messages

包简介

A simple OOP wrapper to work with HTTP messages in PHP

README 文档

README

Latest Version PHP Version Tests Total Downloads

This package is to allow you to create HTTP Messages in PHP, in a simple and reliable way.

Installation

composer require http-php/message

Usage

To use this package, it is very simple. Create a message using the following code:

use HttpPHP\Message\Message;

$message = Message::make(
    payload: ['test' => 'payload'],
);

// Add a header
$message->withHeader(
    key: 'Authorization',
    value: 'Bearer some-super-secret-token',
);

// Fetch the header value
$message->header(
    key: 'Authorization',
)->toString(); // 'Bearer some-super-secret-token'

// Fetch all headers
$message->headers();

// Fetch the payload
$message->payload()->parse(); // Returns an array representation of the payload.
$message->payload()->body(); // Returns the raw payload you wish to send.

Testing

To run the test suite:

composer run test

Credits

LICENSE

The MIT LIcense (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固