PHPackages                             phpnomad/guzzle-fetch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. phpnomad/guzzle-fetch

ActivePackage[HTTP &amp; Networking](/categories/http)

phpnomad/guzzle-fetch
=====================

1.1.1(3mo ago)01.1k↓72.4%[2 PRs](https://github.com/phpnomad/guzzle-fetch-integration/pulls)1MITPHPCI failing

Since Dec 18Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/phpnomad/guzzle-fetch-integration)[ Packagist](https://packagist.org/packages/phpnomad/guzzle-fetch)[ Docs](https://github.com/phoenix/core)[ RSS](/packages/phpnomad-guzzle-fetch/feed)WikiDiscussions main Synced yesterday

READMEChangelog (3)Dependencies (12)Versions (8)Used By (1)

phpnomad/guzzle-fetch
=====================

[](#phpnomadguzzle-fetch)

[![Latest Version](https://camo.githubusercontent.com/6b46b38cb81f4b6187de4044dc4d010c41f77534f73e93fde017cd801b155650/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f67757a7a6c652d66657463682e737667)](https://packagist.org/packages/phpnomad/guzzle-fetch)[![Total Downloads](https://camo.githubusercontent.com/140dd2a25735e48009737dfc70c248f9ae07bdc98661d25f25f6460c6c9b6a71/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f67757a7a6c652d66657463682e737667)](https://packagist.org/packages/phpnomad/guzzle-fetch)[![PHP Version](https://camo.githubusercontent.com/5c91e47890c7f45b4badeb421412c602e74e5f9a23069f99a4969190b1bf0ed4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f67757a7a6c652d66657463682e737667)](https://packagist.org/packages/phpnomad/guzzle-fetch)[![License](https://camo.githubusercontent.com/03074d52c5bd5861e8084c9db046d5ac22e1b30d9dd15475cf109e76bacd6810/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f67757a7a6c652d66657463682e737667)](https://packagist.org/packages/phpnomad/guzzle-fetch)

Integrates `guzzlehttp/guzzle` with PHPNomad's `phpnomad/fetch` abstraction. The package ships a concrete `FetchStrategy` implementation backed by a `GuzzleHttp\Client`, so any application code that constructor-injects `PHPNomad\Fetch\Interfaces\FetchStrategy` can make outbound HTTP requests through Guzzle without touching Guzzle directly.

This is the transport you want in non-WordPress runtimes where `wp_remote_request` is not available: CLI tools, SaaS backends, worker processes, and any PHPNomad application that prefers Guzzle to the WordPress HTTP API.

Installation
------------

[](#installation)

```
composer require phpnomad/guzzle-fetch
```

What This Provides
------------------

[](#what-this-provides)

- `PHPNomad\Guzzle\FetchIntegration\Strategies\FetchStrategy` implements `PHPNomad\Fetch\Interfaces\FetchStrategy`. It holds a `GuzzleHttp\Client`, reads the URL, method, headers, body, and query params off the incoming `FetchPayload`, and forwards them to `Client::request()`. Guzzle exceptions are converted to `PHPNomad\Rest\Exceptions\RestException` with the upstream status code preserved when available.
- `PHPNomad\Guzzle\FetchIntegration\Models\Response` implements `PHPNomad\Http\Interfaces\Response`. The strategy populates it from the Guzzle response and returns it to callers, so downstream code sees the same interface regardless of the underlying transport.
- `PHPNomad\Guzzle\FetchIntegration\Initializer` is the loader hook that binds the strategy to the `FetchStrategy` interface in the DI container.

Requirements
------------

[](#requirements)

- `phpnomad/fetch`, the HTTP abstraction this package implements.
- `guzzlehttp/guzzle`, the HTTP client this package bridges.

The package also pulls in `phpnomad/http`, `phpnomad/rest`, `phpnomad/di`, and `phpnomad/loader` as part of the standard PHPNomad integration surface.

Usage
-----

[](#usage)

Registration goes through `phpnomad/loader`. Add `new Initializer()` to the list of initializers your application passes to the `Bootstrapper`, and the container will bind the Guzzle-backed strategy to `PHPNomad\Fetch\Interfaces\FetchStrategy` during boot.

```
