PHPackages                             icemont/curlwrapper - 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. icemont/curlwrapper

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

icemont/curlwrapper
===================

Simplest OOP CURL Wrapper.

v2.0.1(2y ago)2231MITPHPPHP &gt;=8.0

Since Mar 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Icemont/CurlWrapper)[ Packagist](https://packagist.org/packages/icemont/curlwrapper)[ RSS](/packages/icemont-curlwrapper/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)DependenciesVersions (5)Used By (1)

CurlWrapper
===========

[](#curlwrapper)

[![Latest Stable Version](https://camo.githubusercontent.com/7fdf84677696fe590e18ed543a2cb9f99493f9d6766e7b2753e04974a59f88db/687474703a2f2f706f7365722e707567782e6f72672f6963656d6f6e742f6375726c777261707065722f76)](https://packagist.org/packages/icemont/curlwrapper)[![PHP Version Require](https://camo.githubusercontent.com/252b24b8e38cd802e808b30c62c8b5f65c8699fd5811aad2834a42b51b7584b7/687474703a2f2f706f7365722e707567782e6f72672f6963656d6f6e742f6375726c777261707065722f726571756972652f706870)](https://packagist.org/packages/icemont/curlwrapper)[![License](https://camo.githubusercontent.com/b39a18cd5142bb29944d58003aab640d3eba337c725ce37ab4281b2e3fc37497/68747470733a2f2f706f7365722e707567782e6f72672f6963656d6f6e742f6375726c777261707065722f6c6963656e7365)](//packagist.org/packages/icemont/curlwrapper)

The simplest and smallest OOP wrapper for PHP cURL **with no overhead**.
Designed to test and work with simple RestFull and JSON APIs and execute simple queries.

Installation
------------

[](#installation)

```
$ composer require icemont/curlwrapper

```

Usage
-----

[](#usage)

### Example POST request with custom header and data

[](#example-post-request-with-custom-header-and-data)

> **File:** examples/simple\_request.php

```
use Icemont\cURL\CurlWrapper;

$curl = new CurlWrapper();

/*
 * Preparing request
 */

$curl->setTimeout(5)
     ->setUserAgent('Mozilla/5.0 (compatible; CurlWrapper/2.0)')
     ->setReferer('https://example.com/')
     ->addHeader('API-Key: TEST_KEY')
     ->addData('test', 'value')
     ->addData('param2', 'value2')
     ->addDataFromArray([
        'fromArray1' => 'valueA',
        'fromArray2' => 'valueB',
    ]);

/**
 * Executing the query
 */
var_dump($curl->postRequest('https://httpbin.org/post'));

echo 'Request response code: ' . $curl->getLastCode() . PHP_EOL;
echo 'Request error string: ' . $curl->getLastError() . PHP_EOL;
```

### Simple POST and GET requests

[](#simple-post-and-get-requests)

```
use Icemont\cURL\CurlWrapper;

$curl = new CurlWrapper();

// Executing an empty POST request
var_dump($curl->postRequest('https://httpbin.org/post'));

// Add data and execute a POST request with data sending
$curl->addData('value', 'test')
     ->addData('value2', 'test2');
var_dump($curl->postRequest('https://httpbin.org/post'));

// Execute a simple GET request (data will be added as Query String)
var_dump($curl->getRequest('https://httpbin.org/get'));

// Reset the data and execute a simple GET request again
$curl->reset();
var_dump($curl->getRequest('https://httpbin.org/get'));
```

### Example of new ticket creation via the osTicket API

[](#example-of-new-ticket-creation-via-the-osticket-api)

> **File:** examples/osticket\_create\_ticket.php

```
use Icemont\cURL\CurlWrapper;

$api = new CurlWrapper();

/**
 * Adding data one by one
 */
$api->addHeader('X-API-Key: YOUR_API_KEY')
    ->addData('source', 'API')
    ->addData('name', 'Test User')
    ->addData('email', 'user@example.com')
    ->addData('ip', '127.0.0.1');

/**
 * Or immediately in the array
 */
$api->addDataFromArray([
    'alert' => true,
    'autorespond' => true,
    'subject' => 'Testing API',
    'message' => 'MESSAGE HERE',
]);

/**
 * Executing the query as JSON
 */
var_dump($api->jsonRequest('https://support.example.com/api/tickets.json'));

echo 'Request response code: ' . $api->getLastCode() . PHP_EOL;
echo 'Request error string: ' . $api->getLastError() . PHP_EOL;
```

Contact
-------

[](#contact)

Open an issue on GitHub if you have any problems or suggestions.

License
-------

[](#license)

The contents of this repository is released under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Every ~305 days

Total

4

Last Release

964d ago

Major Versions

v1.1.0 → v2.0.02023-09-27

PHP version history (2 changes)v1.0.1PHP &gt;=7.1

v2.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b6c35e98f550eeccaf9958fd2e144460f650da75c39a997cb63b0731869ad8f?d=identicon)[Icemont](/maintainers/Icemont)

---

Top Contributors

[![Icemont](https://avatars.githubusercontent.com/u/17479623?v=4)](https://github.com/Icemont "Icemont (9 commits)")

---

Tags

apicurlcurl-wrappercurlwrapperoopphp

### Embed Badge

![Health badge](/badges/icemont-curlwrapper/health.svg)

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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