dezento/effective-url-middleware

Guzzle 7 Effective Url Solution

Installs: 37

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/dezento/effective-url-middleware

1.0 2021-05-20 18:44 UTC

This package is auto-updated.

Last update: 2025-11-21 05:07:33 UTC


README

A quick solution for Guzzle 7 to get the request URL from the response.

Instalation

Install via composer

 composer require dezento/effective-url-middleware

Usage

require "vendor/autoload.php";

use Dezento\EffectiveUrlMiddleware;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Client;

$stack = HandlerStack::create();
$stack->push(EffectiveUrlMiddleware::middleware());

$client = new Client([
    'handler' => $stack
]);

$response = $client->request('GET', 'http://httpbin.org/get');

echo $response->getHeaderLine('X-GUZZLE-EFFECTIVE-URL');