utopia-php/psr7
Composer 安装命令:
composer require utopia-php/psr7
包简介
PSR-7 HTTP message implementations and PSR-17 factories for Utopia
README 文档
README
Important
This repository is a read-only mirror of the utopia-php monorepo. Development happens in packages/psr7 — please open issues and pull requests there.
PSR-7 HTTP message implementations and PSR-17 factories for PHP 8.4+.
Install
composer require utopia-php/psr7
Quick Start
<?php use Utopia\Psr7\Method; use Utopia\Psr7\Request; use Utopia\Psr7\Response; use Utopia\Psr7\Stream; require __DIR__ . '/vendor/autoload.php'; $request = new Request\Factory()->json(Method::POST, 'https://example.com/users', [ 'name' => 'Ada', ]); $response = new Response(200, body: new Stream('{"ok":true}')); echo $request->getMethod(); echo $response->json()['ok'];
The package includes immutable request, response, URI, and stream implementations, plus helpers for JSON, XML, text, form, query-string, raw-body, and multipart payloads.
Development
Local copies of the relevant PSR and multipart RFC documents live under docs/, with translated coverage requirements in testing-requirements.md.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-06