http-interop/http-factory-guzzle
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
guzzlehttp/psr7 | 2.6.2 | 76.41 kB | MIT | prod | |
psr/http-factory | 1.1.0 | - | MIT | prod |
The PHP library, "http-interop/http-factory-guzzle", provides a practical solution for creating HTTP messages and streams using a common method. The specialty of this package is that it uses Guzzle's PSR-7 implementation, making it compatible with the PSR-7 HTTP message interface. Its primary goal is to serve as an interoperable HTTP factory bridge between Guzzle and other PHP libraries or projects.
To utilize the "http-interop/http-factory-guzzle" PHP library, first, it must be installed through Composer package manager by executing this command: composer require http-interop/http-factory-guzzle
. Afterward, you can easily integrate it with your server requests, uploads, and responses.
Here are a few examples of how one can employ this library:
// Import the GuzzleHttp\Psr7\Response class.
use GuzzleHttp\Psr7\Response;
// Create a new instance of the Response.
$response = (new Response())->withStatus(200)->withBody('Content Here');
// Import the GuzzleHttp\Psr7\ServerRequest class.
use GuzzleHttp\Psr7\ServerRequest;
// Create a new Server Request instance.
$request = ServerRequest::fromGlobals();
Naturally, the real power of this library is unleashed when it's integrated with other PHP projects or libraries that conform to the PSR-7 standard.
Documentation for the "http-interop/http-factory-guzzle" library is not provided on its GitHub repository page. As this package is an implementation of the Http\Factory interfaces, the primary reference should be PSR-7 HTTP message interfaces and Guzzle's PSR-7 library documentation. They can guide on the usage and protocols this library adheres to. For specific use cases or extensive code examples, developers are advised to browse through relevant forums, blogs, and PHP communities where active usage and discussion about these conventions and related packages occur.