PHPackages                             dinke/curl-http-client - 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. dinke/curl-http-client

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

dinke/curl-http-client
======================

Curl based HTTP Client - Simple but effective OOP wrapper around Curl php lib. It allows sending post/get requests, using proxy, binding to specific IP, storing cookies etc.

v2.0.8(10y ago)195.3k12[1 issues](https://github.com/dinke/curl_http_client/issues)LGPLv3PHPPHP &gt;=5.3.0

Since Oct 12Pushed 10y ago3 watchersCompare

[ Source](https://github.com/dinke/curl_http_client)[ Packagist](https://packagist.org/packages/dinke/curl-http-client)[ Docs](https://github.com/dinke/curl_http_client)[ RSS](/packages/dinke-curl-http-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (8)Used By (0)

CurlHttpClient
==============

[](#curlhttpclient)

Curl based HTTP Client - Simple but effective OOP wrapper around Curl php lib. It allows sending post/get requests, using proxy, binding to specific IP, storing cookies etc.

Installation
============

[](#installation)

Add CurlHttpClient to your composer.json

```
{
    "require": {
        "dinke/curl-http-client": "dev-master"
    }
}

```

Usage
=====

[](#usage)

```
$curl = new \Dinke\CurlHttpClient;

//pretend to be Firefox 19.0 on Mac
$useragent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0";
$curl->setUserAgent($useragent);

//uncomment next two lines if you want to automatically manage cookies
//which will store them to file and send them on each http request
//$cookies_file = "/tmp/cookies.txt";
//$curl->storeCookies($cookies_file);

//Uncomment next line if you want to set credentials for basic http_auth
//$curl->setCredentials($username, $password);

//Uncomment next line if you want to set specific referrer
//$curl->setReferer('http://www.foo.com/referer_url/');

//if you want to send some post data
//form post data array like this one
$post_data = ['login' => 'pera', 'password' => 'joe', 'other_foo_field' => 'foo_value'];
//or like a string: $post_data = 'login=pera&password=joe&other_foo_field=foo_value';

//and send request to http://www.foo.com/login.php. Result page is stored in $html_data string
$html_data = $curl->sendPostData("http://www.foo.com/login.php", $post_data);

//You can also fetch data from somewhere using get method!
//Fetch html from url
$html_data = $curl->fetchUrl("http://www.foo.com/foobar.php?login=pera&password=joe&other_foo_field=foo_value");

//if you have more than one IP on your server,
//you can also bind to specific IP address like ...
//$bind_ip = "192.168.0.1";
//$curl->fetch_url("http://www.foo.com/login.php", $bind_ip);
//$html_data = $curl->sendPostData("http://www.foo.com/login.php", $post_data, $bind_ip);

//and there are many other things you can do like

//use proxy
//$curl->setProxy('http://www.proxyurl.com');

//use proxy auth
//$curl->setProxyAuth('user:pass');

//get http response code for last request
//$http_code = $curl->getHttpResponseCode();

//get last http request duration in sec
//$duration = $curl->get_requestDuration();
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 88% 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 ~50 days

Recently: every ~62 days

Total

6

Last Release

3977d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d01d1c9db54edd7dc7b7e1a534a3396e9818a7aef3fd9cf695da401f2727af8f?d=identicon)[dinke](/maintainers/dinke)

---

Top Contributors

[![dinke](https://avatars.githubusercontent.com/u/1319686?v=4)](https://github.com/dinke "dinke (22 commits)")[![byjg](https://avatars.githubusercontent.com/u/981924?v=4)](https://github.com/byjg "byjg (2 commits)")[![pherum](https://avatars.githubusercontent.com/u/3333352?v=4)](https://github.com/pherum "pherum (1 commits)")

---

Tags

curl

### Embed Badge

![Health badge](/badges/dinke-curl-http-client/health.svg)

```
[![Health](https://phpackages.com/badges/dinke-curl-http-client/health.svg)](https://phpackages.com/packages/dinke-curl-http-client)
```

###  Alternatives

[rmccue/requests

A HTTP library written in PHP, for human beings.

3.6k34.5M253](/packages/rmccue-requests)[kriswallsmith/buzz

Lightweight HTTP client

2.0k31.3M439](/packages/kriswallsmith-buzz)[nategood/httpful

A Readable, Chainable, REST friendly, PHP HTTP Client

1.8k17.2M266](/packages/nategood-httpful)[mashape/unirest-php

Unirest PHP

1.3k9.7M160](/packages/mashape-unirest-php)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48247.0M383](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

83510.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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