guzzle/guzzle


Guzzle, an extensible PHP HTTP client

http://guzzlephp.org/

License: MIT

Language: PHP

Keywords: curl, guzzle, httpclient, psr-7, webservices


Guzzle, PHP HTTP client

Latest Version Build Status Total Downloads

Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services.

  • Simple interface for building query strings, POST requests, streaming large uploads, streaming large downloads, using HTTP cookies, uploading JSON data, etc...
  • Can send both synchronous and asynchronous requests using the same interface.
  • Uses PSR-7 interfaces for requests, responses, and streams. This allows you to utilize other PSR-7 compatible libraries with Guzzle.
  • Abstracts away the underlying HTTP transport, allowing you to write environment and transport agnostic code; i.e., no hard dependency on cURL, PHP streams, sockets, or non-blocking event loops.
  • Middleware system allows you to augment and compose client behavior.
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle');

echo $response->getStatusCode(); # 200
echo $response->getHeaderLine('content-type'); # 'application/json; charset=utf8'
echo $response->getBody(); # '{"id": 1420053, "name": "guzzle", ...}'

# Send an asynchronous request.
$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org');
$promise = $client->sendAsync($request)->then(function ($response) {
    echo 'I completed! ' . $response->getBody();
});

$promise->wait();

Help and docs

Installing Guzzle

The recommended way to install Guzzle is through Composer.

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of Guzzle:

composer require guzzlehttp/guzzle

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

You can then later update Guzzle using composer:

composer update

Version Guidance

Version Status Packagist Namespace Repo Docs PSR-7 PHP Version
3.x EOL guzzle/guzzle Guzzle v3 v3 No >= 5.3.3
4.x EOL guzzlehttp/guzzle GuzzleHttp v4 N/A No >= 5.4
5.x EOL guzzlehttp/guzzle GuzzleHttp v5 v5 No >= 5.4
6.x Latest guzzlehttp/guzzle GuzzleHttp v6 v6 Yes >= 5.5

Project Statistics

Sourcerank 24
Repository Size 8.52 MB
Stars 18,271
Forks 2,011
Watchers 475
Open issues 306
Dependencies 9
Contributors 330
Tags 120
Created
Last updated
Last pushed

Top Contributors See all

Michael Dowling Márk Sági-Kazár Graham Campbell Tobias Nyholm Jeremy Lindblom Mponos George David Abdemoulaie Tobias Schultze Gordon Franke Luis Cordova Danack Jonathan Eskew hussainweb Clay Loveless Konstantin Pelepelin Ben Longden Chris Wilkinson Adrien Brault Artur Bodera Ivan Kerin

Packages Referencing this Repo

guzzlehttp/guzzle
Guzzle is a PHP HTTP client library and framework for building RESTful web service clients
Latest release 6.4.1 - Updated - 18.3K stars
zelenin/curl
Guzzle is a PHP HTTP client library
Latest release 6.5.0 - Updated - 18.3K stars

Recent Tags See all

6.5.0 December 07, 2019
5.3.4 October 30, 2019
6.4.1 October 23, 2019
6.4.0 October 23, 2019
5.3.3 July 31, 2018
6.3.3 April 22, 2018
6.3.2 March 26, 2018
6.3.1 March 26, 2018
5.3.2 January 15, 2018
6.3.0 June 22, 2017
6.2.3 February 28, 2017
6.2.2 October 08, 2016
6.2.1 July 18, 2016
5.3.1 July 15, 2016
4.2.4 July 15, 2016

Interesting Forks See all

cboden/guzzle
Guzzle is a PHP HTTP client and framework for building RESTful web service clients
PHP - MIT - Last pushed - 8 stars - 3 forks
Zhucola/guzzle
Guzzle, an extensible PHP HTTP client
PHP - MIT - Updated - 2 stars
igorw-forks/guzzle
Guzzle is a PHP HTTP client and framework for building RESTful web service clients
PHP - MIT - Last pushed - 2 stars
pda/guzzle
Guzzle is a PHP HTTP client and framework for building RESTful web service clients
PHP - MIT - Last pushed - 2 stars
Acidburn0zzz/guzzle
Guzzle, an extensible PHP HTTP client
PHP - MIT - Updated - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2019-12-07 21:04:31 UTC