awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
php-fig avatar

php-fig/http-message

0
View on GitHub↗
7,049 星标·186 分支·PHP·MIT·1 次浏览www.php-fig.org/psr/psr-7↗

Http Message

PSR-7 HTTP Message Interfaces is a set of standardized PHP interfaces for representing HTTP request and response messages, URIs, streams, and uploaded files as immutable value objects. These interfaces define a common contract that enables interoperability between PHP frameworks and libraries when handling HTTP messages, ensuring that any implementation can be used interchangeably.

The interfaces model HTTP messages as immutable value objects where any modification produces a new instance, guaranteeing message integrity throughout the request lifecycle. They provide case-insensitive header access and retrieval, support for multi-valued headers, and stream-based body handling that enables efficient processing of large payloads without loading them entirely into memory. For server-side requests, the interfaces abstract PHP superglobals into structured objects with attributes for application-specific routing, and normalize uploaded file trees into consistent nested structures with safe file movement and stream access methods.

URI handling is provided through immutable value objects that parse RFC 3986 URIs once and expose individual component accessors for scheme, authority, path, query, and fragment. The interfaces also include validation mechanisms that reject malformed header names and values to prevent injection attacks and parsing errors. The package consists solely of interfaces and does not include any implementations, serving as a foundational contract for the PHP ecosystem.

Features

  • Immutable HTTP Message Models - Models HTTP messages as immutable value objects, the foundational concept of the PSR-7 standard.
  • Immutable HTTP Message - Models HTTP messages as immutable value objects, the core architectural pattern of this package.
  • PHP Interface Standards - Defines the PSR-7 standard interfaces for HTTP messages, the core contract for PHP interoperability.
  • Uploaded File Interfaces - Defines the PSR-7 UploadedFileInterface for safe file handling from PHP superglobals.
  • Streamed Message Body Interfaces - Defines a stream interface for HTTP message bodies as a core part of the PSR-7 standard.
  • Uploaded File Tree Normalizations - Provides a standard interface for normalizing PHP uploaded file data into structured objects.
  • Parameter Bag Abstractions - Wraps PHP superglobals into structured request objects with typed parameter bag access.
  • Multi-Value Headers - Supports returning header values as comma-separated strings or arrays for multi-valued headers.
  • Casing Normalization - Normalizes HTTP header casing for case-insensitive retrieval while preserving original casing.
  • Case-Insensitive Header Normalizers - Provides case-insensitive header normalization as a core part of the PSR-7 HTTP message interface.
  • URI Construction and Parsing - Parses and composes HTTP and HTTPS URIs according to RFC 3986 with component accessors.
  • URI Segment Readers and Modifiers - Provides accessors for individual URI segments like scheme, authority, path, query, and fragment.
  • URI Value Object Interfaces - Defines the PSR-7 UriInterface for immutable URI value objects with component accessors.
  • URI Value Object Parsings - Parses URIs once into value objects for efficient component access without repeated parsing.
  • URI Value Object Representations - Represents URIs as immutable value objects parsed once for efficient segment access.
  • HTTP Message Mapping - Models HTTP messages as immutable value objects, the foundational concept of the PSR-7 standard.
  • Unified Message Element Accessors - Provides unified access to protocol version, headers, and body as a core part of the PSR-7 message interface.
  • Standardized HTTP Message Interfaces - Provides the standardized interface for HTTP request and response messages, the core of the PSR-7 standard.
  • HTTP Header Accessors - Provides case-insensitive header access and retrieval as a core part of the PSR-7 HTTP message interface.
  • PHP Superglobal Request Abstractions - Abstracts PHP superglobals into structured request objects as a core part of the PSR-7 server request interface.
  • Standardized HTTP Request Interfaces - Defines the standard interface for HTTP request messages as a core part of the PSR-7 standard.
  • Standardized HTTP Response Interfaces - Defines the standard interface for HTTP response messages as a core part of the PSR-7 standard.
  • Server-Side Request Parameter Accessors - Provides access to server-side request parameters as a core part of the PSR-7 server request interface.
  • Body Streaming - Models message bodies as streamable objects for efficient processing of large payloads.
  • Stream Interfaces - Provides the PSR-7 StreamInterface for efficient body handling without full memory loading.
  • PHP Superglobal Abstractions - Abstracts PHP superglobals into structured request objects as a core part of the PSR-7 server request interface.
  • Uploaded File Tree Normalizations - Normalizes PHP uploaded file data into a predictable tree of file objects.
  • Host Header Rewriting - Synchronizes the Host header with the URI's host component as a feature of the PSR-7 request interface.
  • URI-Based Host Header Synchronizers - Synchronizes the Host header with the URI's host component as a feature of the PSR-7 request interface.
  • Safe Uploaded File Movers - Provides safe file movement for uploaded files as a feature of the PSR-7 uploaded file interface.
  • Uploaded File Tree Normalizers - Normalizes the PHP $_FILES array into a consistent tree structure as a feature of the PSR-7 uploaded file interface.
  • HTTP Header Validations - Enforces standardized naming and value constraints on HTTP headers to prevent injection attacks.
  • Header Name and Value Validations - Rejects malformed header names and values to prevent CRLF injection and parsing attacks.
  • Request Target Overrides - Allows overriding the default request target to support specialized HTTP request forms.
  • Request-Target Form Handlers - Supports all four forms of the HTTP request-target as a feature of the PSR-7 request interface.
  • Request Target Representations - Defines the four standard forms of HTTP request targets for message representation.

Star 历史

php-fig/http-message 的 Star 历史图表php-fig/http-message 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

常见问题解答

php-fig/http-message 是做什么的?

PSR-7 HTTP Message Interfaces is a set of standardized PHP interfaces for representing HTTP request and response messages, URIs, streams, and uploaded files as immutable value objects. These interfaces define a common contract that enables interoperability between PHP frameworks and libraries when handling HTTP messages, ensuring that any implementation can be used interchangeably.

php-fig/http-message 的主要功能有哪些?

php-fig/http-message 的主要功能包括:Immutable HTTP Message Models, Immutable HTTP Message, PHP Interface Standards, Uploaded File Interfaces, Streamed Message Body Interfaces, Uploaded File Tree Normalizations, Parameter Bag Abstractions, Multi-Value Headers。

php-fig/http-message 有哪些开源替代品?

php-fig/http-message 的开源替代品包括: boostorg/beast — Beast is a C++ library for implementing low-level HTTP and WebSocket clients and servers. It functions as an… ralouphie/getallheaders — This project is a PHP environment compatibility library and polyfill designed to provide a consistent interface for… codeigniter4/codeigniter4 — CodeIgniter is a PHP web framework built on the Model-View-Controller pattern, designed for building full-stack web… aplus-framework/http — This library provides a foundational set of tools for managing HTTP communication within PHP web applications. It… zendframework/zendframework — Zend Framework is a comprehensive set of decoupled components for building modular, event-driven web applications. It… elastic/elasticsearch-php — This project is a software development kit and cluster management tool for PHP. It serves as a full-text search SDK…

Http Message 的开源替代方案

相似的开源项目,按与 Http Message 的功能重合度排序。
  • boostorg/beastboostorg 的头像

    boostorg/beast

    4,801在 GitHub 上查看↗

    Beast is a C++ library for implementing low-level HTTP and WebSocket clients and servers. It functions as an asynchronous networking framework designed to compose non-blocking I/O operations and layered stream stacks for managing concurrent network traffic, specifically utilizing the Boost.Asio asynchronous model. The library provides a comprehensive implementation of the HTTP/1.1 and WebSocket protocols. For HTTP, it includes primitives for parsing and serializing messages with support for chunked transfer encoding, incremental body reading, and request pipelining. Its WebSocket implementati

    C++asioasync-programmingboost
    在 GitHub 上查看↗4,801
  • codeigniter4/codeigniter4codeigniter4 的头像

    codeigniter4/CodeIgniter4

    5,924在 GitHub 上查看↗

    CodeIgniter is a PHP web framework built on the Model-View-Controller pattern, designed for building full-stack web applications. It provides a lightweight toolkit with minimal configuration, organizing application logic into controllers, models, and views for clean separation of concerns. The framework includes a fluent query builder for constructing SQL statements programmatically, PSR-4 autoloading with namespace mapping, and a service-based dependency injection container for managing shared class instances. The framework distinguishes itself through its comprehensive set of built-in tools

    PHPcodeignitercodeigniter4framework-php
    在 GitHub 上查看↗5,924
  • ralouphie/getallheadersralouphie 的头像

    ralouphie/getallheaders

    3,795在 GitHub 上查看↗

    This project is a PHP environment compatibility library and polyfill designed to provide a consistent interface for retrieving all incoming HTTP request headers. It functions as a request header parser that extracts and normalizes raw server variables into a predictable associative array. The library ensures cross-platform behavior by detecting missing native functions at runtime and injecting fallback implementations. This allows for standardized request header retrieval and server variable normalization across diverse server architectures and configurations.

    PHP
    在 GitHub 上查看↗3,795
  • aplus-framework/httpaplus-framework 的头像

    aplus-framework/http

    237在 GitHub 上查看↗

    This library provides a foundational set of tools for managing HTTP communication within PHP web applications. It focuses on the lifecycle of client-server interactions by parsing incoming request data into structured objects and facilitating the construction of protocol-compliant server responses. The architecture is built around immutable data structures that ensure state consistency throughout the application lifecycle. It incorporates lazy header parsing to reduce memory overhead and utilizes stream-based management for handling request and response payloads. By adhering to established co

    PHPanti-csrfaplusaplus-framework
    在 GitHub 上查看↗237
  • 查看 Http Message 的所有 30 个替代方案→