italodeveloper/guzzle-zend

Abstrai o modelo de requisição do Guzzle e transforma em Zend Http Requests XD

This package's canonical repository appears to be gone and the package has been frozen as a result.

1.2.1 2019-05-24 14:57 UTC

This package is auto-updated.

Last update: 2022-02-25 01:14:34 UTC


README

🤘 Guzzle to Zend Http Adapter, justa change you instance ;)

O pacote está disponivel somente no metodo $client->request(...), as demais funções e novas implementações estão em aberto via GitHub.

Basta utilizar, de forma identica a utilização do Guzzle.

Zend Http + Adapter

<?php
use ZendAdapter\ZendRequest as Client;

require __DIR__ . '/vendor/autoload.php';
$client = new Client([
    'base_uri' => 'http://httpbin.org',
    'timeout'  => 2.0,
]);

$response = $client->request('GET', '/root');
$response = $client->request('GET', '/root');
$responseBody = $response->getBody();
$responseBodyContents = $responseBody->getContents();

Guzzle

<?php
use GuzzleHttp\Client;

require __DIR__ . '/vendor/autoload.php';
$client = new Client([
    'base_uri' => 'http://httpbin.org',
    'timeout'  => 2.0,
]);

$response = $client->request('GET', '/root');
$responseBody = $response->getBody();
$responseBodyContents = $responseBody->getContents();