1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-12 03:24:26 +01:00
Michael Dowling 241611c4cd Improving URL encoding of path and query.
This commit updates path and query string encoding to better handle
strings that are already percent encoded, and now allows for all of the
characters valid for paths and queries specified in RFC 3986 to be
present in a URL without being encoded.
2014-10-30 16:52:02 -07:00
2014-10-12 18:39:23 -07:00
2014-10-29 11:11:35 -04:00
2014-08-19 22:02:13 -07:00
2014-10-24 18:24:14 +01:00
2014-03-29 16:11:36 -07:00
2014-10-12 19:30:59 -07:00

Guzzle, PHP HTTP client and webservice framework

Build Status

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

  • Manages things like persistent connections, represents query strings as collections, simplifies sending streaming POST requests with fields and files, and abstracts away the underlying HTTP transport layer.
  • Can send both synchronous and asynchronous requests using the same interface without requiring a dependency on a specific event loop.
  • Pluggable HTTP adapters allows Guzzle to integrate with any method you choose for sending HTTP requests over the wire (e.g., cURL, sockets, PHP's stream wrapper, non-blocking event loops like ReactPHP.
  • Guzzle makes it so that you no longer need to fool around with cURL options, stream contexts, or sockets.
$client = new GuzzleHttp\Client();
$response = $client->get('http://guzzlephp.org');
$res = $client->get('https://api.github.com/user', ['auth' =>  ['user', 'pass']]);
echo $res->getStatusCode();
// "200"
echo $res->getHeader('content-type');
// 'application/json; charset=utf8'
echo $res->getBody();
// {"type":"User"...'
var_export($res->json());
// Outputs the JSON decoded data

// Send an asynchronous request.
$req = $client->createRequest('GET', 'http://httpbin.org', ['future' => true]);
$client->send($req)->then(function ($response) {
    echo 'I completed! ' . $response;
});

Get more information and answers with the Documentation, Forums, and Gitter.

Installing via Composer

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

Documentation

More information can be found in the online documentation at http://guzzlephp.org/.

Description
No description provided
Readme 16 MiB
Languages
PHP 97.5%
JavaScript 1.8%
Makefile 0.6%