承接 borschphp/headers 相关项目开发

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

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

borschphp/headers

最新稳定版本:1.0.1

Composer 安装命令:

composer require borschphp/headers

包简介

A library to help deal with headers.

README 文档

README

A library to help deal with headers.
Convenient to deal with headers in your PSR-7 implementations.

Installation

The package can be installed via composer. Simply run the following command:

composer require borschphp/headers

Usage

use Borsch\Http\Header;
use Borsch\Http\HeadersMap;

$content_type = new Header('Content-Type', 'application/json');
$content_disposition = new Header('Content-Disposition', 'attachment', 'filename="test.pdf"');
$accept_encoding = new Header('Accept-Encoding', 'gzip', 'deflate');
$cache_control = new Header('Cache-Control', 'no-cache');

$headers = new HeadersMap($content_type, $content_disposition, $accept_encoding);

$headers->add(
    new Header('Cache-Control', 'no-cache')
);

if ($headers->has('accept-encoding')) {
    echo $headers->get('ACCEPT-ENCODING')->__toString();
    // Accept-Encoding: gzip, deflate
}

foreach ($headers as $header) {
    /** @var Header $header */
    $name = $header->getName();
    $values = $header->getValues();
}

Tests

The package includes a set of tests (made with Pest) to ensure that everything is working as expected.
You can run the tests by executing the following command:

./vendor/bin/pest

License

The package is licensed under the MIT license. See License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固