Skip to content

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

Notifications You must be signed in to change notification settings

Dezento/effective-url-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Guzzle 7 Effective Url Middleware

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');

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages