PHPackages                             bainternet/curlo - 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. bainternet/curlo

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

bainternet/curlo
================

Simple curl wrapper for PHP based on the WordPress HTTP curl class

471PHP

Since Sep 24Pushed 10y ago2 watchersCompare

[ Source](https://github.com/bainternet/Curlo)[ Packagist](https://packagist.org/packages/bainternet/curlo)[ RSS](/packages/bainternet-curlo/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Curlo
=====

[](#curlo)

Simple Curl wrapper for PHP based on the WordPress HTTP curl class.

- This class is some-what based on the WordPress HTTP Curl class and HTTP API so some of the code comes from there.

---

Install
=======

[](#install)

You can download this project in either [zip](https://github.com/bainternet/Curlo/zipball/master) or [tar](https://github.com/bainternet/Curlo/tarball/master) formats.

You can also clone the project with Git by running:

```
$ git clone git://github.com/bainternet/Curlo.git

```

Or you can use Composer (prefered method) to include the class in your project

```
$ php composer.phar require bainternet/curlo

```

How to Use?
===========

[](#how-to-use)

Simple, Include the class file in your application bootstrap (setup/load/configuration or whatever you call it) and start creating HTTP request.

```
//include the class
include_once('path/to/src/curlo.php');

//instantiate a new curlo
$request  = new Curlo\Curlo();
```

\####Simple get Request

```
//get the response of a GET request
$response = $request->get('https://en.bainternet.info');
var_dump($response);
```

\####Simple post Request

```
//make a POST request
$response = $request->post('https://en.bainternet.info/login',
	array(
		'username' => 'Ohad',
		'password' => 'XXXXXXX'
	)
);
var_dump($response);
```

#### Response Example

[](#response-example)

```
array (size=4)
	'headers' => array (size=8)
		'server' => string 'cloudflare-nginx' (length=16)
		'date' => string 'Thu, 17 Sep 2015 15:10:57 GMT' (length=29)
		'content-type' => string 'text/html; charset=UTF-8' (length=24)
		'transfer-encoding' => string 'chunked' (length=7)
		'connection' => string 'keep-alive' (length=10)
		'set-cookie' => string '__cfduid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX; expires=Fri, 16-Sep-16 15:10:56 GMT; path=/; domain=.bainternet.info; HttpOnly' (length=132)
		'x-pingback' => string 'http://en.bainternet.info/xmlrpc.php' (length=36)
		'cf-ray' => string 'XXXXXXXXXXXXX-FRA' (length=20)
	'body' => string ''... (length=65756)
	'response' => array (size=2)
		'code' => int 200
		'message' => string 'OK' (length=2)
	'cookies' => array (size=1)
		0 => object(Curlo\Curlo_Cookie)[2]
			public 'name' => string '__cfduid' (length=8)
			public 'value' => string 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (length=43)
			public 'expires' => int 1474038656
			public 'path' => string '/' (length=1)
			public 'domain' => string '.bainternet.info' (length=16)
			public 'httponly' => string '' (length=0)
			....

```

Methods
=======

[](#methods)

**add\_header** add headers to request

```
 - @access public
 - @since 0.1
 - @param mixed $header  string with $val set as value or as an array of key|value
 - @param mixed $val     header value
 - @return object Curlo instance

```

```
$request->add_header( 'Accept', 'application/json')
->add_header( 'Content-Type', 'application/json');

//same as above
$request->add_header( array(
	'Accept'       => 'application/json',
	'Content-Type' => 'application/json'
);
```

License
=======

[](#license)

Since this class is derived from the WordPress HTTP API so are the license and they are GPL

[![Analytics](https://camo.githubusercontent.com/56e8bfcc0d983f9d54ac3b721d4c47c0574e90bc332055f3de2b1d9da1a3408a/68747470733a2f2f67612d626561636f6e2e61707073706f742e636f6d2f55412d35303537333133352d392f4375726c6f2f6d61696e)](https://github.com/bainternet/Curlo)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a6ff565efa16143dc0996d43b47893545d384b169684f6f79d2e677989e32eb?d=identicon)[bainternet](/maintainers/bainternet)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/bainternet-curlo/health.svg)

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

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

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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