PHPackages                             kajna/curli - 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. kajna/curli

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

kajna/curli
===========

Object-Oriented interface for PHP cUrl extension

0.9.0(10y ago)119MITPHPPHP &gt;=5.4.0

Since Jun 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Kajna/Curli)[ Packagist](https://packagist.org/packages/kajna/curli)[ RSS](/packages/kajna-curli/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Curli
=====

[](#curli)

[![DUB](https://camo.githubusercontent.com/17e9757cbb55c60de819f19cd32613d4fc879fe79b5e6d9e8fbbb534328adee2/68747470733a2f2f696d672e736869656c64732e696f2f6475622f6c2f766962652d642e737667)](http://opensource.org/licenses/MIT)[![Version](https://camo.githubusercontent.com/0f986965397599e789b8f1d2381dded38c57951bd341f44d02a857744c1090da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d302e392e302d6f72616e67652e737667)](https://packagist.org/packages/kajna/curli)

Lightweight library with object-oriented interface for sending HTTP requests

### Installing

[](#installing)

This package is available via Composer:

```
{
  "require": {
    "kajna/curli": "dev-master"
  }
}
```

Usage examples
==============

[](#usage-examples)

### Fetching HTML page using GET

[](#fetching-html-page-using-get)

```
try {
	$curli = (new \Curli\Curli())
			->get('http://example.com')
			->close();

	$response = $curli->response();

	echo $response->asText();
} catch(\Exception $e) {
	echo $e->getMessage();
}
```

### Sending and receiving JSON data using PUT with connection timeout

[](#sending-and-receiving-json-data-using-put-with-connection-timeout)

```
try {
	$data = array('foo' => 'bar');
	$json = json_encode($data);

	$curli = (new \Curli\Curli())
			->setConnectionTimeout(3)
			->setHeader('Content-Type', 'application/json')
			->setHeader('Content-Length', strlen($json))
			->setParams($json)
			->put('http://example.com')
			->close();

	$response = $curli->response();

	print_r($response->asObject());
} catch(\Exception $e) {
	echo $e->getMessage();
}
```

### Sending and receiving XML data using POST

[](#sending-and-receiving-xml-data-using-post)

```
try {
	$data = 'bar';

	$curli = (new \Curli\Curli())
			->setUserAgent('curl 7.16.1 (i386-portbld-freebsd6.2) libcurl/7.16.1 OpenSSL/0.9.7m zlib/1.2.3')
			->setHeader('Content-Type', 'text/xml')
			->setHeader('Content-Length', strlen($data))
			->setParams($data)
			->post('http://example.com')
			->close();

	$response = $curli->response();

	print_r($response->asArray());
} catch(\Exception $e) {
	echo $e->getMessage();
}
```

Author
======

[](#author)

Author of library is Milos Kajnaco

Licence
=======

[](#licence)

Curli is released under the [MIT](http://opensource.org/licenses/MIT) public license.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

3665d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/05b21474c04a1957849d3f9c496a37c868340646b1e5c7c5226e72689415a5db?d=identicon)[Kajna](/maintainers/Kajna)

---

Top Contributors

[![Kajna](https://avatars.githubusercontent.com/u/4723904?v=4)](https://github.com/Kajna "Kajna (6 commits)")

---

Tags

jsonrestxmlcurl

### Embed Badge

![Health badge](/badges/kajna-curli/health.svg)

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

###  Alternatives

[tcdent/php-restclient

A generic REST API client for PHP

3523.0M29](/packages/tcdent-php-restclient)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.5k](/packages/ismaeltoe-osms)[hgg/pardot

Pardot API library for building custom CRM connectors

23101.0k](/packages/hgg-pardot)

PHPackages © 2026

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