talira

HTTP Factory for Guzzle

PSR-17 HTTP factory implemented on Guzzle's PSR-7 messages

open sourceMITfree

HTTP Factory for Guzzle (http-interop/http-factory-guzzle) is a PHP package that implements the PSR-17 HTTP factory interfaces on top of Guzzle's guzzlehttp/psr7 messages. Since version 2.0, guzzlehttp/psr7 ships its own factory, and this package's README asks projects that can use it to do so.

Problems it solves

  • I need a PSR-17 request and response factory for Guzzle's PSR-7 messages
  • a library asks for psr/http-factory-implementation and my project still uses guzzlehttp/psr7 1.x
  • create PSR-7 requests and streams from Guzzle through the standard PSR-17 interfaces

Features

  • provides psr/http-factory-implementation (PSR-17) using guzzlehttp/psr7
  • works with guzzlehttp/psr7 1.7 and 2.x

Limitations

  • Superseded: guzzlehttp/psr7 includes its own HTTP factory from version 2.0, and the README asks projects that can require guzzlehttp/psr7 ^2.0 to use that instead.1

Alternatives

The same job

These do what HTTP Factory for Guzzle does.

  1. nyholm/psr7 Small, strict and fast PSR-7 and PSR-17 implementation for PHP
  2. laminas-diactoros PSR-7 HTTP messages and PSR-17 factories for PHP, from Laminas
  3. Slim-Psr7 Strict PSR-7 HTTP message implementation from the Slim Framework

Compare HTTP Factory for Guzzle with the top 3