Download the PHP package oro/guzzle without Composer
On this page you can find all versions of the php package oro/guzzle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package guzzle
Short Description This is a fork of an older verions of PHP HTTP client - https://github.com/guzzle/guzzle3. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle
License MIT
Homepage http://guzzlephp.org/
Informations about the package guzzle
Guzzle, PHP HTTP client and webservice framework
Guzzle is a PHP HTTP client and framework for building RESTful web service clients.
- Extremely powerful API provides all the power of cURL with a simple interface.
- Truly take advantage of HTTP/1.1 with persistent connections, connection pooling, and parallel requests.
- Service description DSL allows you build awesome web service clients faster.
- Symfony2 event-based plugin system allows you to completely modify the behavior of a request.
Get answers with: Documentation, Forums, IRC (#guzzlephp @ irc.freenode.net)
Installing via Composer
The recommended way to install Guzzle is through Composer.
After installing, you need to require Composer's autoloader:
Installing via phar
Download the phar and include it in your project (minimal phar)
Features
- Supports GET, HEAD, POST, DELETE, PUT, PATCH, OPTIONS, and any other custom HTTP method
- Allows full access to request and response headers
- Persistent connections are implicitly managed by Guzzle, resulting in huge performance benefits
- Send requests in parallel
- Cookie sessions can be maintained between requests using the CookiePlugin
- Allows custom entity bodies, including sending data from a PHP stream and downloading data to a PHP stream
- Responses can be cached and served from cache using the caching forward proxy plugin
- Failed requests can be retried using truncated exponential backoff with custom retry policies
- Entity bodies can be validated automatically using Content-MD5 headers and the MD5 hash validator plugin
- All data sent over the wire can be logged using the LogPlugin
- Subject/Observer signal slot system for unobtrusively modifying request behavior
- Supports all of the features of libcurl including authentication, compression, redirects, SSL, proxies, etc
- Web service client framework for building future-proof interfaces to web services
- Includes a service description DSL for quickly building webservice clients
- Full support for URI templates
- Advanced batching functionality to efficiently send requests or commands in parallel with customizable batch sizes and transfer strategies
HTTP basics
Using the static client facade
You can use Guzzle through a static client to make it even easier to send simple HTTP requests.
Available request options:
- headers: Associative array of headers
- query: Associative array of query string values to add to the request
- body: Body of a request, including an EntityBody, string, or array when sending POST requests. Setting a body for a GET request will set where the response body is downloaded.
- auth: Array of HTTP authentication parameters to use with the request. The array must contain the username in index [0], the password in index [1], and can optionally contain the authentication type in index [2]. The authentication types are: "Basic", "Digest". The default auth type is "Basic".
- cookies: Associative array of cookies
- allow_redirects: Set to false to disable redirects
- save_to: String, fopen resource, or EntityBody object used to store the body of the response
- events: Associative array mapping event names to a closure or array of (priority, closure)
- plugins: Array of plugins to add to the request
- exceptions: Set to false to disable throwing exceptions on an HTTP level error (e.g. 404, 500, etc)
- timeout: Float describing the timeout of the request in seconds
- connect_timeout: Float describing the number of seconds to wait while trying to connect. Use 0 to wait indefinitely.
- verify: Set to true to enable SSL cert validation (the default), false to disable, or supply the path to a CA bundle to enable verification using a custom certificate.
- proxy: Specify an HTTP proxy (e.g. "http://username:[email protected]:10")
- debug: Set to true to display all data sent over the wire
These options can also be used when creating requests using a standard client:
Unit testing
Guzzle uses PHPUnit for unit testing. In order to run the unit tests, you'll first need
to install the dependencies of the project using Composer: php composer.phar install --dev
.
You can then run the tests using vendor/bin/phpunit
.
If you are running the tests with xdebug enabled, you may encounter the following issue: 'Fatal error: Maximum function nesting level of '100' reached, aborting!'. This can be resolved by adding 'xdebug.max_nesting_level = 200' to your php.ini file.
The PECL extensions, uri_template and pecl_http will be required to ensure all the tests can run.