PHPackages                             urmaul/httpclient - 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. urmaul/httpclient

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

urmaul/httpclient
=================

It is a PHP wrapper for curl.

1.1.1(9y ago)4115.7k↓38.5%13MITPHPPHP &gt;=5.3

Since Oct 13Pushed 9y ago1 watchersCompare

[ Source](https://github.com/urmaul/httpclient)[ Packagist](https://packagist.org/packages/urmaul/httpclient)[ Docs](https://github.com/urmaul/httpclient)[ RSS](/packages/urmaul-httpclient/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (4)Used By (3)

Php Http Client
===============

[](#php-http-client)

It is a PHP wrapper for curl.

The main idea was just to make HTTP requests with one-liners. And cookie support out-of-the box.

For something more complex you probably want Guzzle.

[![Build Status](https://camo.githubusercontent.com/3427ff9a27c1b243ed53b0357c1979e416c8ccc381702adcc2d15fc1f94b2fd8/68747470733a2f2f7472617669732d63692e6f72672f75726d61756c2f68747470636c69656e742e737667)](https://travis-ci.org/urmaul/httpclient)

How to use
----------

[](#how-to-use)

Like that.

```
HttpClient::from(['useRandomCookieFile' => true])->get('http://httpbin.org/get');

HttpClient::from()->post('http://httpbin.org/post', ['foo' => 'bar']);

HttpClient::from()->download('http://httpbin.org/image/jpeg', 'my-new-image-file.jpeg');
```

### Methods

[](#methods)

- **head($url, $params = array())** - performs http request to get responce headers.
- **get($url, $params = array())** - performs http GET request.
- **post($url, $post = array(), $params = array())** - performs http POST request.
- **download($url, $dest, $post = array(), $params = array())** - downloads file.
- **request($params)** - performs http request.
- **getInfo($opt = null)** - Returns information about the last transfer. [Details](http://www.php.net/manual/ru/function.curl-getinfo.php)

### Possible $params values

[](#possible-params-values)

- **url** - *(string)* request url.
- **post** - *(string|array)* request POST data.
- **ref** - *(string)* "Referer" request header content.
- **header** - *(boolean, default = false)* whether to include response header into response.
- **nobody** - *(boolean, default = false)* whether to NOT include response body into response.
- **timeout** - *(integer, default = 15)* request timeout.
- **tofile** - *(string, default = null)* output file name. If defined - response will be saved to that file.
- **attempts\_max** - *(integer, default = 1)* maximum number of attempts to perform HTTP request.
- **attempts\_delay** - *(integer, default = 10)* delay between attempts, in seconds

### Readonly properties

[](#readonly-properties)

- **$lastError** - (string) last request error.
- **$info** - (array) information about the last transfer.
- **$httpCode** - (integer) last received HTTP code.
- **$effectiveUrl** - (string) last effective url.
- **$cookies** - (array) cookies array. **Warning,** after calling this property you will be not able to get another properties.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

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 ~316 days

Total

3

Last Release

3602d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/22364b943477de78bf89bb19b5708a93666e38b5f1ad954ded9c656b3c116cb8?d=identicon)[urmaul](/maintainers/urmaul)

---

Tags

httpclient

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/urmaul-httpclient/health.svg)

```
[![Health](https://phpackages.com/badges/urmaul-httpclient/health.svg)](https://phpackages.com/packages/urmaul-httpclient)
```

PHPackages © 2026

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