HTTP_Request2
pear.php.net
HTTP_Request
Provides an easy way to perform HTTP requests.
PHP5 rewrite of HTTP_Request package (with parts of HTTP_Client). Provides cleaner API and pluggable Adapters: * Socket adapter, based on old HTTP_Request code, * Curl adapter, wraps around PHP's cURL extension, * Mock adapter, to use for testing packages dependent on HTTP_Request2. Supports POST requests with data and file uploads, basic and digest authentication, cookies, managing cookies across requests, proxies, gzip and deflate encodings, redirects, monitoring the request progress with Observers...
Alexey Borzov
avb
avb@php.net yes
2012-04-08
07:27:30
2.1.1
2.1.0
stable
stable
BSD License
Fixes for SOCKS5 proxies support in Socket adapter
5.2.0
1.9.2
Net_URL2
pear.php.net
2.0.0
PEAR
pear.php.net
1.9.2
curl
fileinfo
zlib
openssl
2012-04-07
2.1.0
2.1.0
stable
stable
BSD License
New features: * Mock adapter can return responses based on request URL (request #19276) * Support for SOCKS5 proxies, added 'proxy_type' configuration parameter (request #19332) * Proxy configuration may be given as an URL, e.g. $request->setConfig('proxy', 'socks5://localhost:1080');

Other changes and fixes: * Coding standards fixes (request #14990) * Unit tests now run from SVN checkout and under PHPUnit 3.6.x * Explicit dependency on PEAR (until PEAR_Exception is a separate package) * Get rid of track_errors, use a more robust solution (bug #19337) * Additional class_exists() check in setAdapter() (request #19344) * Public suffix list updated to current version
2011-10-20
2.0.0
2.0.0
stable
stable
BSD License
2.0.0RC2 repackaged as stable and depending on stable Net_URL2. No code changes.
2011-10-01
2.0.0RC2
2.0.0
beta
stable
BSD License
* Added an accessor method for HTTP_Request2_Response::$phrases (request #18716) * HTTP_Request2::send() throws an exception if URL is not provided rather than dies with a fatal error (bug #18755) * Public Suffix List updated to current version
2011-05-06
2.0.0RC1
2.0.0
beta
stable
BSD License
SSL options for Curl Adapter are always set, this prevents errors when redirecting from HTTP to HTTPS (bug #18443)
2.0.0beta3
2.0.0
beta
beta
2011-04-03
BSD License
* Added getEffectiveUrl() method to Response object, it returns the URL response was received from, possibly after redirects (request #18412) * Curl Adapter didn't send body for PUT requests sometimes (bug #18421)
2.0.0beta2
2.0.0
beta
beta
2011-03-25
BSD License
* Unit tests can now be run under recent PHPUnit versions (3.5+) * Public Suffix List updated to current version * PHP warning produced by stream_socket_client() in Socket adapter is now added to Exception message (bug #18331)
2.0.0beta1
2.0.0
beta
beta
2011-02-27
BSD License
Additions and changes: * Implemented cookie jar that allows to store and pass cookies across HTTP requests (see request #18225) * Added several specialized subclasses of HTTP_Request2_Exception, they are now thrown instead of the parent. Also added error codes and possibility to get native error code (as returned by stream_socket_client() and curl_errno()) (request #16762) * An additional 'sentBody' event is now sent to Observers (request #16828) * setBody() and addUpload() can now accept file pointers (request #16863)

Bugfixes: * Incorrect check in Socket Adapter prevented Keep-alive from working in some cases (bug #17031)
0.6.0
0.6.0
alpha
alpha
2011-02-14
BSD License
Additions and changes: * Added test suite that interacts with a webserver. Please refer to tests/NetworkConfig.php.dist for instructions. * Packaging changes: docs/ and tests/ contents are installed without redundant subdirectories. * Added a $replace parameter to HTTP_Request2::setHeader() that controls whether new header value will overwrite previous one or be appended to it (request #17507)

Bugfixes: * Fixed a typo in Curl Adapter that prevented 'strict_redirects' from working * Curl Adapter will throw an exception if CURLOPT_FOLLOWLOCATION can not be enabled due to PHP setup (bug #17450) * Allow parameters in manually set Content-Type headers (bug #17460) * Properly reset redirect limit if multiple requests are performed with the same instance of Socket Adapter (bug #17826) * Response::getBody() no longer tries to decode empty strings (bug #18169)
0.5.2
0.5.0
alpha
alpha
2010-04-21
BSD License
* magic_quotes_runtime PHP setting could be incorrectly enabled after performing the request (bug #16440) * Unit tests fixes (bugs #17079, #17106, #17326) * Observer_Log now appends to the log file rather than rewrites it (thanks to troelskn at gmail dot com for reporting)
0.5.1
0.5.0
alpha
alpha
2009-11-21
BSD License
* Content-Type request header is no longer removed for POST and PUT requests with empty request body (request #16799). * CURLOPT_NOBODY option is now set when doing HEAD requests with Curl adapter.
0.5.0
0.5.0
alpha
alpha
2009-11-18
BSD License
* Redirect support added, new configuration parameters 'follow_redirects', 'max_redirects' and 'strict_redirects' available

* Implemented workaround for PHP bug #47204, Curl Adapter can now handle Digest authentication and redirects when doing POST requests, unfortunately this requires loading the entire request body into memory. * Config parameter 'use_brackets' is propagated to created instances of Net_URL2 * Prevent memory leaks due to circular references (request #16646) * Fixed a misleading error message when timing out due to default_socket_timeout * HTTP_Request2::setBody() can now accept an instance of HTTP_Request2_MultipartBody without trying to convert it to string * Calling HTTP_Request2::setBody() now clears post parameters and uploads
0.4.1
0.4.0
alpha
alpha
2009-09-14
BSD License
* Decoding of gzipped responses failed if mbstring.func_overload was enabled (bug #16555) * Changed boundary generation in multipart bodies to work correctly with rapidshare.com, added first usage example: file uploading to rapidshare.com * Added forgotten optional dependency on OpenSSL PHP extension
0.4.0
0.4.0
alpha
alpha
2009-05-03
BSD License
* Added 'store_body' config parameter, if set to false it will prevent storing the response body in Response object (request #15881) * HTTP_Request2::setHeader() method now works as documented, setHeader('name') will remove the 'name' header, while setHeader('name', '') will set 'name' header to empty value (bug #15937) * Custom 'Host' header will not be overwritten by generated one (bug #16146) * When trying to reuse the connected socket in Socket adapter, make sure that it is still connected (bug #16149)
0.3.0
0.3.0
alpha
alpha
2009-01-28
BSD License
API changes: * Removed HTTP_Request2::getConfigValue() method

Feature additions: * Added digest authentication (RFC 2617) support to Socket adapter. Thanks to Tom Snyder (tomsn at inetoffice dot com) who sent me a prototype implementation for HTTP_Request a couple of years ago. * Added HTTPS proxy support to Socket adapter, this works through CONNECT request described in RFC 2817. * Mock adapter can now throw an Exception instead of returning a response if Exception object is added via its addResponse() method (request #15629)

Other changes and fixes: * Support RFC 3986 by not encoding '~' in POST body (request #15368) * Prevent an error with particular versions of PHP and Curl (bug #15617) * Regular expressions used in HTTP_Request2 are now class constants (request #15630) * Curl adapter now throws an exception in case of malformed (non-HTTP) response rather than dies with a fatal error (bug #15716) * Curl handle wasn't closed in Curl adapter in case of error (bug #15721) * Curl adapter sent an extra 'sentHeaders' event and returned bogus response status when server returned 100-Continue response (bug #15785)
0.2.0
0.2.0
alpha
alpha
2009-01-07
BSD License
API changes: * HTTP_Request2::getConfigValue() is deprecated and will be removed in next release. Use HTTP_Request2::getConfig(). * Changed HTTP_Request2::setConfig() to accept a pair of parameter name and parameter value in addition to array('parameter name' => 'value') * Added HTTP_Request2::getConfig() method that can return a single configuration parameter or the whole configuration array

Other additions and changes: * Added a debug Observer that can log request progress to a file or an instance of PEAR::Log (thanks to David Jean Louis, request #15424) * Added a new 'timeout' parameter that limits total number of seconds a request can take (see requests #5735 and #8964) * Added various SSL protocol options: 'ssl_verify_peer', 'ssl_verify_host', 'ssl_cafile', 'ssl_capath', 'ssl_local_cert', 'ssl_passphrase'. Note that 'ssl_verify_host' option behaves differently in Socket and Curl Adapters: http://bugs.php.net/bug.php?id=47030

Fixes: * Fixed 'data error' when processing response encoded by 'deflate' encoding (bug #15305) * Curl Adapter now passes full request headers in 'sentHeaders' event
0.1.0
0.1.0
alpha
alpha
2008-11-17
BSD License
Initial release. The features supported are mostly the same as those of HTTP_Request, with the following additional feature requests implemented: * cURL extension support (request #5463) * It is now possible to monitor the file upload progress with Observers (request #7630) * Added 'sentHeaders' notification providing the request headers to the Observers (request #7633) * Added support for 'deflate' encoding (request #11246)