Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. PHP
  3. Nyholm PSR-7

Nyholm PSR-7

MITPHP1.8.2

A super lightweight, strict, and fast PSR-7 and PSR-17 implementation for PHP.

GitHubGitHub
1.3k stars78 forks0 contributors

What is Nyholm PSR-7?

Nyholm/psr7 is a PHP library that provides a complete and strict implementation of the PSR-7 (HTTP message interfaces) and PSR-17 (HTTP factories) standards. It is designed to be minimal, highly compliant, and optimized for performance, offering efficient HTTP message handling without extra bloat.

Target Audience

PHP developers building applications or libraries that require PSR-7/PSR-17 compliant HTTP message handling, such as those working with HTTP clients, servers, or frameworks like Symfony.

Value Proposition

Developers choose Nyholm/psr7 because it is a lightweight, fast, and strictly compliant implementation that outperforms alternatives in benchmarks, with a small codebase of around 1,000 lines and no unnecessary features.

Overview

A super lightweight PSR-7 implementation

Use Cases

Best For

  • Projects requiring a high-performance PSR-7/PSR-17 implementation with minimal overhead.
  • Symfony Flex applications where automatic service registration for HTTP message factories is needed.
  • Integrating with HTTPlug for flexible HTTP client usage in PHP.
  • Building HTTP servers or clients that demand strict adherence to PSR standards without extra helper methods.
  • Benchmark-sensitive applications where faster HTTP message processing is critical.
  • Lightweight libraries or microservices aiming to reduce dependencies and code footprint.

Not Ideal For

  • Projects needing helper methods for common HTTP tasks like parsing query strings or handling cookies
  • Teams using frameworks with built-in PSR-7 implementations (e.g., Laravel with Guzzle) who prefer not to add another dependency
  • Applications requiring extensive documentation or tutorials beyond basic PSR-7 usage
  • Developers who want a more feature-rich library with built-in utilities beyond the PSR-7/17 specifications

Pros & Cons

Pros

Strict Standards Compliance

Achieves 100% on PSR-7 integration tests, fully adhering to specifications without extra public methods, as highlighted in the README comparison table.

Benchmark-Leading Performance

Outperforms Guzzle, Laminas, and Slim in benchmarks with 17,734 runs per second, making it ideal for performance-critical applications.

Minimal Code Footprint

Has only 1,000 lines of code, significantly less than competitors like Guzzle (3,300 lines), reducing overhead and maintenance burden.

Seamless Symfony Integration

With Symfony Flex, HTTP message factories are automatically registered as services, simplifying setup for Symfony-based projects.

HTTPlug Compatibility

Easily integrates with HTTPlug for flexible HTTP client usage, as shown in the usage examples with libraries like Buzz.

Cons

No Helper Methods

Strictly follows PSR-7, so common utilities like URL parsing or cookie management are absent, requiring manual implementation or additional packages.

Additional Dependencies Needed

For full functionality, such as server requests or response emission, you must install separate packages like nyholm/psr7-server or laminas/laminas-httphandlerrunner.

Limited Ecosystem Support

While it works with HTTPlug and Symfony, it lacks the extensive middleware or plugin ecosystem of more established libraries like Guzzle or Laminas.

Sparse Documentation

The README is concise and focuses on basic usage, which may not suffice for developers new to PSR-7 or needing in-depth guidance on advanced scenarios.

Frequently Asked Questions

Quick Stats

Stars1,277
Forks78
Contributors0
Open Issues4
Last commit9 months ago
CreatedSince 2016

Tags

#lightweight#psr-7#api-client#psr-17#php#performance

Built With

P
PHP

Included in

PHP32.5k
Auto-fetched 11 hours ago

Related Projects

GuzzleGuzzle

Guzzle, an extensible PHP HTTP client

Stars23,458
Forks2,393
Last commit2 days ago
RequestsRequests

Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.

Stars3,574
Forks503
Last commit6 days ago
SaloonSaloon

🤠 Build beautiful API integrations and SDKs with Saloon

Stars2,439
Forks127
Last commit3 days ago
Symfony HTTP ClientSymfony HTTP Client

Provides powerful methods to fetch HTTP resources synchronously or asynchronously

Stars2,028
Forks53
Last commit8 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub