krak/http-message
最新稳定版本:v0.1.3
Composer 安装命令:
composer require krak/http-message
包简介
Psr7 Http Message Utilities
README 文档
README
Simple utilities for the psr http message (psr7) specification.
Headers
We provide several utilities for parsing special headers.
Each header class is named after the specific http header and has the following functions for parsing and signing.
Here's an example using the AcceptHeader class
<?php use Krak\HttpMessage; // grab from a psr http message $accept_header = HttpMessage\AcceptHeader::fromHttpMessage($psr_req); // parse from a string $accept_header = HttpMessage\AcceptHeader::fromString('text/*;q=0.1,text/html;q=0.2'); // You can then sign an http message with the header, which will write the value of the header into the req. $req = $accept_header->signHttpMessage($req); // You can also export the header as a string echo $accept_header;
We provide abstractions with the following classes:
Krak\HttpMessage\AuthorizationHeaderKrak\HttpMessage\AcceptHeaderKrak\HttpMessage\ContentTypeHeader
Matchers
The Krak\HttpMessage\Match directory holds functional utilities for creating matchers for http message requests.
统计信息
- 总下载量: 912
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-07-11