PHPackages                             findologic/http\_request2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. findologic/http\_request2

ActiveLibrary[HTTP &amp; Networking](/categories/http)

findologic/http\_request2
=========================

Provides an easy way to perform HTTP requests.

v2.4.0(6y ago)09.2k2[1 PRs](https://github.com/findologic/HTTP_Request2/pulls)BSD-3-ClausePHPPHP &gt;=7.3

Since Jan 12Pushed 6y ago2 watchersCompare

[ Source](https://github.com/findologic/HTTP_Request2)[ Packagist](https://packagist.org/packages/findologic/http_request2)[ Docs](https://github.com/findologic/HTTP_Request2)[ RSS](/packages/findologic-http-request2/feed)WikiDiscussions trunk Synced 4d ago

READMEChangelog (1)Dependencies (3)Versions (10)Used By (0)

HTTP\_Request2
==============

[](#http_request2)

[![Build Status](https://camo.githubusercontent.com/d951ec56b61fb73bbd48196e90e3af604a1ec04419355d5b12b894d62ccfd696/68747470733a2f2f7472617669732d63692e6f72672f706561722f485454505f52657175657374322e7376673f6272616e63683d7472756e6b)](https://travis-ci.org/pear/HTTP_Request2)

---

**DISCLAMER!** This project is no longer actively maintained and only updated if future PHP versions break compatibility.

If for any reason you want to use this project, use [Guzzle](https://github.com/guzzle/guzzle) instead. It is much better, maintained, has many more features and is generally speaking the way to go if you want to send HTTP requests with PHP.

---

Provides an easy way to perform HTTP requests, uses pluggable adapters

- Socket: pure PHP implementation of HTTP protocol (does *not* use http stream wrapper), based on older [PEAR HTTP\_Request](http://pear.php.net/package/HTTP_Request/) package
- Curl: wrapper around PHP's cURL extension
- Mock: used for testing packages depending on HTTP\_Request2, returns predefined responses without network interaction

Both Socket and Curl adapters support POST requests with data and file uploads, basic and digest authentication, cookies, managing cookies across requests, HTTP and SOCKS5 proxies, gzip and deflate encodings, redirects, monitoring the request progress with Observers...

This package is [PEAR HTTP\_Request2](http://pear.php.net/package/HTTP_Request2/) and has been migrated from [PEAR SVN](https://svn.php.net/repository/pear/packages/HTTP_Request2)

Please report all issues via the [PEAR bug tracker](http://pear.php.net/bugs/search.php?cmd=display&package_name%5B%5D=HTTP_Request2).

Pull requests are welcome.

Basic usage
-----------

[](#basic-usage)

```
require_once 'HTTP/Request2.php';

$request = new HTTP_Request2('http://pear.php.net/', HTTP_Request2::METHOD_GET);
try {
    $response = $request->send();
    if (200 == $response->getStatus()) {
        echo $response->getBody();
    } else {
        echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
             $response->getReasonPhrase();
    }
} catch (HTTP_Request2_Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

Documentation
-------------

[](#documentation)

...is available on PEAR website

- Numerous [configuration options](http://pear.php.net/manual/en/package.http.http-request2.config.php)
- How to populate [the request object](http://pear.php.net/manual/en/package.http.http-request2.request.php)
- Description of [available adapters](http://pear.php.net/manual/en/package.http.http-request2.adapters.php)
- Processing of [HTTP response](http://pear.php.net/manual/en/package.http.http-request2.response.php)
- Monitoring the progress of request with [observers](http://pear.php.net/manual/en/package.http.http-request2.observers.php)
- Possible [exceptions](http://pear.php.net/manual/en/package.http.http-request2.exceptions.php)

[Generated API documentation](http://pear.php.net/package/HTTP_Request2/docs/latest/) for the current release is also there.

Testing, Packaging and Installing (Pear)
----------------------------------------

[](#testing-packaging-and-installing-pear)

To test, run either

```
$ phpunit tests/

```

or

```
$ pear run-tests -r

```

You may need to set up the NetworkConfig.php file if you want to perform tests that interact with a web server. Its template is NetworkConfig.php.dist file, consult it for the details.

To build, simply

```
$ pear package

```

To install from scratch

```
$ pear install package.xml

```

To upgrade

```
$ pear upgrade -f package.xml

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 89.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~571 days

Total

5

Last Release

2222d ago

PHP version history (2 changes)v2.2.0PHP &gt;=5.2.0

v2.4.0PHP &gt;=7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20741025?v=4)[Codex Fons](/maintainers/codexfons)[@codexfons](https://github.com/codexfons)

![](https://www.gravatar.com/avatar/6971dc7475dbc578cb9aa4379421f56c493e1e849a6d94bf70b0b8e6194772bb?d=identicon)[g.sorst@findologic.com](/maintainers/g.sorst@findologic.com)

---

Top Contributors

[![sad-spirit](https://avatars.githubusercontent.com/u/4820288?v=4)](https://github.com/sad-spirit "sad-spirit (160 commits)")[![CloCkWeRX](https://avatars.githubusercontent.com/u/365751?v=4)](https://github.com/CloCkWeRX "CloCkWeRX (7 commits)")[![gauthierm](https://avatars.githubusercontent.com/u/120511?v=4)](https://github.com/gauthierm "gauthierm (3 commits)")[![howard](https://avatars.githubusercontent.com/u/26047?v=4)](https://github.com/howard "howard (3 commits)")[![deliank](https://avatars.githubusercontent.com/u/5559223?v=4)](https://github.com/deliank "deliank (2 commits)")[![ktomk](https://avatars.githubusercontent.com/u/352517?v=4)](https://github.com/ktomk "ktomk (1 commits)")[![mrook](https://avatars.githubusercontent.com/u/477719?v=4)](https://github.com/mrook "mrook (1 commits)")[![phansys](https://avatars.githubusercontent.com/u/1231441?v=4)](https://github.com/phansys "phansys (1 commits)")

---

Tags

httprequestcurlPEAR

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/findologic-http-request2/health.svg)

```
[![Health](https://phpackages.com/badges/findologic-http-request2/health.svg)](https://phpackages.com/packages/findologic-http-request2)
```

###  Alternatives

[pear/http_request2

Provides an easy way to perform HTTP requests.

764.2M48](/packages/pear-http-request2)[aplus/http-client

Aplus Framework HTTP Client Library

2161.6M1](/packages/aplus-http-client)[pdeans/http

PSR-7 cURL HTTP client with support for PSR-17 HTTP factories.

1466.2k3](/packages/pdeans-http)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
