Home » HTTP » HTTP_Request
Provides an easy way to perform HTTP requests
This package is unmaintained.
Download latest release 1.4.4 (archived versions might be outdated)
License: BSD
Description
Supports GET/POST/HEAD/TRACE/PUT/DELETE, Basic authentication, Proxy,
Proxy Authentication, SSL, file uploads etc.
Documentation
Maintainers
- Richard Heyes (richard) — lead, inactive
- Alexey Borzov (avb) — lead, active
Dependencies
Required
- PHP (>= 4.2.0)
- PEAR Installer (>= 1.4.3)
- Net_URL (>= 1.0.12)
- Net_Socket (>= 1.0.7)
Releases
- 1.4.4 (stable, 2008-11-17)
Release notes
License: BSD
Development of HTTP_Request package is halted, only bug fixing will be done.
Please submit feature requests for HTTP_Request2 package.Fixes:
* Improved memory usage of _buildRequest() method (bug #14574)
* Clarified documentation for addFile() method to mention that it is useful
only for POST method file uploads (bug #14635)
* Do not send "Content-Length: 0" header for methods other than
POST and PUT, as some servers may return error 400 (bug #14740) - 1.4.3 (stable, 2008-07-21)
Release notes
License: BSD
* Added possibility to get reason phrase from HTTP response (request #12352)
* PHP 4.2.0 should be the minimal PHP version (bug #12354), also updated other
dependencies' versions to saner values
* Send a Content-Length header in request even if body is empty (request #12900)
* Do not pass length parameter to gzinflate(), it could cause problems in some
corner cases (bugs #13135, #14370)
* Return an error if trying to do a HTTPS request without OpenSSL support
(bug #14127)
* Do not stop reading chunked response body prematurely (bug #14200) - 1.4.2 (stable, 2007-10-26)
Release notes
License: BSD
* The final CRLF was not properly added to request headers on POST request
with no post data (Thanks to Brock Weaver)
* Added error codes (request #12335, thanks to Joe Stump for the patch)
* HTTP_Request sent broken requests on redirects with no trailing slash
(bug #12308, thanks to Joe Stump for the patch)
* Requests with a body consisting of only a symbol '0' were sent without body
(reported privately by Sam Ghods)
* download-progress.php example was broken since 1.4.0 due to addition of
'connect' and 'disconnect' events. Now works again. - 1.4.1 (stable, 2007-05-18)
Release notes
License: BSD
* Removed bogus parameter for getURL() (Bug #9586, thanks to Martin Jansen)
* Improved API documentation (Bug #9984, thanks to Martin Jansen)
* Fixed wrong Content-Length if using mbstring function overloading (bug #10605)
* Fixed bogus "data CRC check failed" error on 64-bit systems (bug #10790,
thanks to Bill Moran)
* Redone the way package handles mbstring function overloading, this will allow
using gzip Content-Encoding when said overloading is switched on
* Added proper header comment blocks, improved phpdoc comments - 1.4.0 (stable, 2006-10-25)
Release notes
License: BSD
* Added Keep-Alive support (request #4806), thanks to Justin Patrin for the
initial patch. Please note that "Connection: close" header is still added
by default, you need to explicitly add "Connection: Keep-Alive" header or
remove "Connection" header if using HTTP 1.1
* A new disconnect() method was added which forces disconnection from the
server if Keep-Alive is used. Also two new events are sent to the Listeners:
"connect" and "disconnect"
* Added getUrl() method (request #6589)
* Added method to properly parse header of gzip-encoded data (see RFC 1952).
This takes care of situations when the server adds some additional data
to the header (bug #8245) or sends data that is not gzip-encoded when
"Content-Encoding: gzip" header is present (bug #8213)
* "Proxy-Authorization" header is now properly set by constructor
(bug #5913)
* Fixed doc comments mentioning addBody() method instead of proper setBody()
(bug #5969)
* Fixed erroneous removal of "Content-Type" header from request
(bug #7922)
* Bogus HTTP headers are now ignored (bug #8214)
* Path is set to "/" if an URL without path (http://www.example.com)
is given (bug #8662)
* Moved to package.xml version 2.0 - 1.3.0 (stable, 2005-11-06)
Release notes
License: BSD
* All request and response headers are now treated case-insensitively,
per RFC 2616 (bug #1045, bug #4367).
* Values of multiple response headers with the same name are combined
into a comma-separated string per RFC 2616 (bug #1045)
* Generate proper closing boundary for multipart/form-data requests,
per RFC 1521 (bug #4397)
* magic_quotes_runtime directive is switched off when performing the
request since it may break file uploads and chunked responses (bug #4543)
* Response::_readChunked() will finish on zero-length chunk rather than
socket eof (patch from bug #3037)
* Added HTTP_Request::setBody() method, deprecated addRawPostData() due to
misleading name. The request body will be sent with all request methods
except those that explicitly forbid this (e.g. TRACE). Data set via
addPostData() / addFile() will only be sent with POST (see request #4716) - 1.2.4 (stable, 2004-12-30)
Release notes
License: BSD
* Notice was raised when processing a response containing secure
cookies (bug #2741)
* Warning was raised when processing a response with empty body and
chunked Transfer-encoding (bug #2792)
* Improved inline documentation on constructor parameters (bug #2751) - 1.2.3 (stable, 2004-10-01)
Release notes
License: BSD
* Auth information is properly extracted from URLs of the form http://user:pass@host/
(bug #1507)
* Connection to server is closed after performing request (bug #1692)
* Use correct argument separator for generated query stings (bug #1857, see
also bug #704 for Net_URL)
* Do not use gzip encoding if certain string functions are overloaded by
mbstring extension (bug #1781)
* addPostData() now properly handles multidimensional arrays (bug #2233) - 1.2.2 (stable, 2004-05-19)
Release notes
License: BSD
Bug fixes:
* Fixed #1037 (unable to connect to port 80 through HTTPS). This relies
on fix for Net_URL bug #1036, thus Net_URL 1.0.12 is now required.
* Fixed #1333 (sending POST data on non-POST requests).
* Fixed #1433 (overwriting the variable name when adding multiple files
for upload). - 1.2.1 (stable, 2004-04-29)
Release notes
License: BSD
Additions and changes:
* Applied patch from #851 (First parameter of constructor is now optional)
* Implemented #526 (It is now possible to set timeout on socket, via
parameter readTimeout)
* Implemented #1141 (It is now possible to pass options to socket via
parameter socketOptions, Net_Socket 1.0.2 is needed for this functionality)
Fixes:
* Fixed #842 (Doc comments incorrectly described the possible return values)
* Fixed #1152 (Incorrect handling of cookies with '=' in value)
* Fixed #1158 (Cookie parameters are not necessarily lowercase)
* Fixed #1080 (Cookies should not be urlencoded/urldecoded) - 1.2 (stable, 2003-10-27)
Release notes
License: BSD
Feature additions:
* Support for multipart/form-data POST requests and file uploads (partly based on Christian Stocker's work)
* Brackets [] after array variables are optional (on by default, controlled by useBrackets parameter)
* HTTP_Request now implements a Subject-Observer design pattern. It is possible to add Listeners
to the Request object to e.g. draw a progress bar when downloading a large file. This is partly
based on Stefan Walk's work. A usage example for this is available.Migration to 1.2:
* Redirect support is now OFF by default
* Redirect support is DEPRECATED
* Methods clearCookies(), clearPostData(), reset() are DEPRECATEDFixes:
* Fixed PEAR bug #18 (Lowercased headers, fix by Dave Mertens)
* Fixed PEAR bug #131 (Domain without trailing slash)
* Fixed PHP bug #25486 (100 Continue handling)
* Fixed PEAR bug #150 (Notices being generated)
* Fixed problems with HTTP responses without bodies - 1.1.1 (stable, 2003-01-30)
Release notes
License: BSD
Added redirect support. Net_URL 1.0.7 is now required.
- 1.1.0 (stable, 2003-01-20)
Release notes
License: BSD
Added SSL support as long as you have PHP 4.3.0+ and the OpenSSL extension. Net_URL 1.0.6 is now required.
- 1.0.2 (stable, 2002-09-16)
Release notes
License: BSD
Added cookie support
- 1.0.1 (stable, 2002-07-27)
Release notes
License: BSD
License change
Bugs
| ID | Status | Type | Version | Date | Summary |
|---|---|---|---|---|---|
| #16 | Wont fix | Bug | 2003-09-17 | https doesn't work when using a proxy | |
| #18 | Closed | Bug | 2003-09-17 | Bad check for Location header in redirects | |
| #46 | Wont fix | Bug | 2003-09-29 | Buggy Posting Data with Redirects | |
| #131 | Closed | Bug | 2003-10-20 | bug when url is / | |
| #144 | Bogus | Bug | 2003-10-22 | HTTP_Request | |
| #150 | Closed | Bug | 2003-10-24 | There are errors generated when upgrading to 0.8RC2 | |
| #526 | Closed | Bug | 2004-01-06 | Fail to call setTimeout() in Net_Socket leaves program hanging | |
| #842 | Closed | Bug | 2004-02-23 | wrong return type and values | |
| #851 | Closed | Bug | 2004-02-25 | Patch: Making first parameter of constructor optional | |
| #976 | Bogus | Bug | 2004-03-08 | Feature Request: Client Certificate support for SSL | |
| #1037 | Closed | Bug | 2004-03-19 | Cannot connect to port 80 through HTTPS | |
| #1041 | Bogus | Bug | 2004-03-20 | Cannot add same GET/POST parameter more than once | |
| #1045 | Closed | Bug | 2004-03-20 | HTTP_Response ignores all but the last of multiple headers with equal name | |
| #1080 | Closed | Bug | 2004-03-26 | Cookies UrlEncoded | |
| #1141 | Closed | Bug | 2004-04-05 | Feature Request (with diff) - socket connect options | |
| #1152 | Closed | Bug | 2004-04-06 | Cookies with an = in them get truncated | |
| #1158 | Closed | Bug | 2004-04-07 | Cookie "parameters" are incorrectly assumed to have lower case names | |
| #1165 | Bogus | Bug | 2004-04-08 | Bad request to Win2003 IIS6 server | |
| #1305 | No Feedback | Bug | 2004-04-28 | addCookie() incorrectly calls urlencode() | |
| #1333 | Closed | Bug | 2004-05-03 | HTTP_Request always sets Content-Type on requests | |
| #1433 | Closed | Bug | 2004-05-18 | Posting multible files | |
| #1507 | Closed | Bug | 2004-05-26 | Basic auth in url is not honoured by default | |
| #1692 | Closed | Bug | 2004-06-21 | disconnect() method is needed | |
| #1781 | Closed | Bug | 2004-07-03 | Failure to decode gzip-encoded content | |
| #1857 | Closed | Bug | 2004-07-12 | & in request query string | |
| #1867 | Bogus | Bug | 2004-07-14 | method addRawPostData stopped working when upgrading 1.2.1 to 1.2.2 | |
| #2233 | Closed | Req | 2004-08-26 | addPostData to recursively map urlencode | |
| #2254 | Closed | Req | 2004-08-30 | Cookies on Redirect | |
| #2284 | Bogus | Bug | 2004-09-06 | Fail to POST multiline COOKIE string | |
| #2693 | No Feedback | Req | 2004-11-04 | Can't set POST request body | |
| #2741 | Closed | Bug | 2004-11-12 | Handling of secure cookies | |
| #2750 | Duplicate | Req | 2004-11-13 | _readTimeout not easily available in params | |
| #2751 | Closed | Bug | 2004-11-13 | _timeout incorrectly documented & _timeout and _readTimeout not consistent | |
| #2792 | Closed | Bug | 2004-11-19 | Transfer-encoding chunked with empty body triggers an error | |
| #3037 | Closed | Bug | 2004-12-27 | hang until socket close in an HTTP/1.1 request | |
| #3196 | Bogus | Bug | 2005-01-13 | HTTP_Request doesn't disconnect socket | |
| #3492 | Wont fix | Bug | 2005-02-16 | Redirect on Location doesn't work correctly with GET args | |
| #3803 | Bogus | Bug | 2005-03-14 | Cannot set "Content-type" header | |
| #4051 | Bogus | Bug | 2005-04-04 | Overwrite multiple query string parameters | |
| #4367 | Closed | Bug | 2005-05-17 | content-type is unexpectedly case-sensitive for POST requests | |
| #4397 | Closed | Bug | 2005-05-20 | not terminating multipart/form-data correctly | |
| #4505 | Wont fix | Req | 2005-06-01 | Should remember cookies between redirects | |
| #4543 | Closed | Bug | 2005-06-07 | Function _readChunked gives errors when magic_quotes are on | |
| #4716 | Closed | Req | 2005-06-30 | support for search method | |
| #4806 | Closed | Req | 2005-07-12 | Implement keep-alive support | |
| #4880 | Bogus | Bug | 2005-07-22 | Bug with addRawPostData | |
| #5909 | Bogus | Bug | 2005-11-09 | Response headers are stored twice | |
| #5910 | Bogus | Bug | 2005-11-09 | getResponseHeader() method is case-sensitive | |
| #5913 | Closed | Bug | 2005-11-09 | Proxy-Authentication header not added | |
| #5966 | Wont fix | Req | 2005-11-15 | trying to get page through proxy when the request's server is a loopback | |
| #5969 | Closed | Bug | 2005-11-15 | Documentation Wrong (Not a real bug) | |
| #5981 | No Feedback | Bug | 2005-11-16 | HTTP_Client hangs on POST requests | |
| #6589 | Closed | Req | 2006-01-26 | Request to get the currently generated url | |
| #6610 | Bogus | Bug | 2006-01-27 | "Connection refused" dies hard | |
| #6800 | Bogus | Bug | 1.3.0 | 2006-02-16 | having a fatal error |
| #7450 | Bogus | Bug | 1.3.0 | 2006-04-21 | cannot request a https link through HTTP_REQUEST |
| #7643 | No Feedback | Bug | 2006-05-16 | SSL Requests Fail | |
| #7691 | Wont fix | Bug | 1.3.0 | 2006-05-22 | Timeout values conflict max_execution_time |
| #7767 | Wont fix | Req | 1.3.0 | 2006-05-31 | disturbing echo |
| #7846 | Bogus | Req | 1.3.0 | 2006-06-09 | posted form data elements with the same name are overwritten by the latest |
| #7922 | Closed | Bug | 1.3.0 | 2006-06-16 | content-type is removed on mistake |
| #8213 | Closed | Bug | 1.3.0 | 2006-07-14 | Warning: gzinflate() data error in C:\AppServ\php\PEAR\HTTP\Request.php on line |
| #8214 | Closed | Bug | 1.3.0 | 2006-07-14 | Ignore invalid HTTP headers |
| #8245 | Closed | Bug | 1.1.0 | 2006-07-19 | Empty body (gzip?)in CurrentResponse |
| #8588 | Bogus | Req | 1.3.0 | 2006-08-30 | ssl certified managment |
| #8662 | Closed | Bug | 1.1.0 | 2006-09-08 | Cookies don't get sent if empty url path |
| #8741 | Bogus | Bug | 1.3.0 | 2006-09-20 | Incorrect cookie value parsing |
| #9094 | Bogus | Bug | 1.3.0 | 2006-10-19 | strict warnings in request.php |
| #9265 | Wont fix | Bug | 1.4.0 | 2006-11-08 | Getting errorcode 400 on request with allowRedirects set to true |
| #9374 | Bogus | Bug | 2006-11-18 | Incorrect work HTTP_Request::_readChunked() | |
| #9567 | Bogus | Bug | 2006-12-07 | soap error with ssk | |
| #9586 | Closed | Bug | 1.4.0 | 2006-12-08 | getUrl has invalid parameter |
| #9984 | Closed | Doc | 1.4.0 | 2007-01-31 | documentation for HTTP_Request class not linked |
| #10425 | Closed | Bug | 1.4.0 | 2007-03-20 | unable to use repeated QS elements |
| #10605 | Closed | Bug | 1.4.0 | 2007-04-04 | Wrong Content-Length on Unicode configuration |
| #10790 | Closed | Bug | 1.4.0 | 2007-04-21 | false error : _decodeGzip(): data CRC check failed |
| #11374 | Wont fix | Bug | 1.4.1 | 2007-06-20 | HTTP_Request uses POST for redirected calls |
| #11383 | Wont fix | Req | 1.4.1 | 2007-06-21 | Please use Net URL2 |
| #12308 | Closed | Bug | 1.4.1 | 2007-10-22 | Malformed GET requests on redirects when no trailing slash |
| #12335 | Closed | Req | 1.4.1 | 2007-10-24 | Add error codes to HTTP_Request |
| #12352 | Closed | Req | CVS | 2007-10-28 | adding the reason phrase to HTTP_Response |
| #12354 | Closed | Bug | CVS | 2007-10-28 | wrong version in dependence to PHP |
| #12616 | Bogus | Req | 1.4.2 | 2007-12-05 | spews if php error_reporting is set to E_STRICT |
| #12822 | No Feedback | Bug | 1.4.2 | 2008-01-04 | Connection re-create on keep-alive requests |
| #12900 | Closed | Req | 1.4.2 | 2008-01-14 | Content-Length should be specified |
| #13135 | Closed | Bug | 2008-02-16 | Problem with gzip-encoded sites | |
| #13247 | Bogus | Req | 1.4.2 | 2008-02-28 | Digest authentication is inefficient |
| #13381 | Closed | Doc | 1.4.2 | 2008-03-12 | Error in title |
| #14127 | Closed | Bug | 1.4.2 | 2008-06-12 | Request to check if openssl exists |
| #14200 | Closed | Bug | 1.4.2 | 2008-06-20 | Reading of chunked responses stops early |
| #14370 | Closed | Bug | 1.4.2 | 2008-07-19 | Error on empty gzipped documents |
| #14402 | No Feedback | Bug | 1.4.3 | 2008-07-24 | Always sending content-length (fix for #12900) breaks (certain?) servers |
| #14574 | Closed | Bug | 1.4.3 | 2008-08-27 | bad memory usage of the _buildRequest method of Http_Request Class |
| #14623 | Wont fix | Req | 2008-09-09 | Listener for request | |
| #14635 | Closed | Doc | 1.4.3 | 2008-09-10 | Data is not allowed in PUT requests. |
| #14654 | Wont fix | Bug | 1.4.3 | 2008-09-17 | E_NOTICES for HTTP_Request |
| #14692 | Closed | Doc | 2008-09-22 | User note that is a documentation problem | |
| #14740 | Closed | Bug | 1.4.3 | 2008-10-04 | GET REQUEST Content-Length Header Problem |
| #18095 | Wont fix | Req | 1.4.4 | 2010-12-03 | Redirect at HTTP-Status Code 302 with POST-Data |
| #18127 | Bogus | Bug | 1.4.4 | 2010-12-20 | https url can't get |
| #19322 | Wont fix | Req | 2012-03-08 | Removing new instances passed by reference from Request class |