webclient/ext-redirect

Redirect extension for PSR-18 HTTP client

v1.0.1 2020-11-04 09:11 UTC

This package is auto-updated.

Last update: 2021-05-04 10:14:58 UTC


README

Latest Stable Version Total Downloads License PHP

webclient/ext-redirect

Redirect extension for PSR-18 HTTP client.

Install

Install this package and your favorite psr-18 implementation.

composer require webclient/ext-redirect:^1.0

Using

<?php

use Webclient\Extension\Redirect\Client;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestInterface;

/** 
 * @var ClientInterface $client Your PSR-18 HTTP Client
 * @var int $maxRedirects Max follow redirects
 */
$http = new Client($client, $maxRedirects);

/** @var RequestInterface $request */
$response = $http->sendRequest($request);