PHPackages                             naivic/curl - 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. naivic/curl

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

naivic/curl
===========

Naivic cURL envelope

1.2.0(6mo ago)026MITPHPPHP &gt;=7.1

Since Sep 1Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/Naivic/CURL)[ Packagist](https://packagist.org/packages/naivic/curl)[ RSS](/packages/naivic-curl/feed)WikiDiscussions main Synced 1mo ago

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

Naivic\\CURL : PHP class to ease most of cURL-related tasks
===========================================================

[](#naiviccurl--php-class-to-ease-most-of-curl-related-tasks)

Some examples:
--------------

[](#some-examples)

### Simplest GET query - get book information from the openlibrary.org

[](#simplest-get-query---get-book-information-from-the-openlibraryorg)

```
$url = "http://openlibrary.org/search.json";
$needle = "Alice Wonderland";
$curl = new \Naivic\CURL();
$res = $curl->query( "GET", $url, [ "q" => $needle ] );
echo "Total time: ".$res["info"]["total_time"]." sec\n";
echo "Year: ".$res["data"]["docs"][0]["first_publish_year"]."\n";
```

result

```
Total time: 21.788099 sec
Year: 1889

```

### Simple REST API - POST, GET, PUT, PATCH, DELETE queries

[](#simple-rest-api---post-get-put-patch-delete-queries)

Used  to illustrate functionality

Lets prepare to make series of REST API requests:

```
$url = "https://api.restful-api.dev/objects";
$hdr = [ "Content-Type: application/json" ];
$hero = [
    "name" => "The Cat",
    "data" => [
        "type"     => "animal",
        "location" => "World",
    ],
];
$curl = new \Naivic\CURL();
```

Ok, now put The Cat to World, and store ID from server response

```
$res = $curl->query( "POST", $url, $hero, $hdr );
$id = $res["data"]["id"];
```

$res\["data"\]:

```
Array
(
    [id] => ff80818191ad7c2f0191af6b4a550247
    [name] => The Cat
    [createdAt] => 2024-09-01T21:08:49.883+00:00
    [data] => Array
        (
            [type] => animal
            [location] => World
        )

)

```

Then, move The Cat to Wonderland

```
$hero["data"] = [
    "type"     => "sapiens",
    "location" => "Wonderland",
];
$res = $curl->query( "PUT", $url."/".$id, $hero, $hdr );
```

$res\["data"\]:

```
Array
(
    [id] => ff80818191ad7c2f0191af6b4a550247
    [name] => The Cat
    [updatedAt] => 2024-09-01T21:08:51.547+00:00
    [data] => Array
        (
            [type] => sapiens
            [location] => Wonderland
        )

)

```

And... swap The Cat to Alice!

```
$res = $curl->query( "PATCH", $url."/".$id, ["name" => "Alice"], $hdr );
print_r( $res["data"] );
```

$res\["data"\]:

```
Array
(
    [id] => ff80818191ad7c2f0191af6b4a550247
    [name] => Alice
    [updatedAt] => 2024-09-01T21:08:52.623+00:00
    [data] => Array
        (
            [type] => sapiens
            [location] => Wonderland
        )

)

```

Knock-knock, wake up Alice

```
$res = $curl->query( "DELETE", $url."/".$id, hdr: $hdr );
```

$res\["data"\]:

```
Array
(
    [message] => Object with id = ff80818191ad7c2f0191af6b4a550247 has been deleted.
)

```

Where is Alice? ("who the ... is Alice?")

```
$res = $curl->query( "GET", $url."/".$id, hdr: $hdr );
```

$res\["data"\]:

```
Array
(
    [error] => Oject with id=ff80818191ad7c2f0191af6b4a550247 was not found.
)

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance66

Regular maintenance activity

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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

Total

4

Last Release

202d ago

PHP version history (2 changes)1.0.0PHP &gt;=8.1

1.1.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5bf98e37eba430f06cc83a00d073fb59d57fe1ca78316d2d80e58b0900564ba3?d=identicon)[Naivic](/maintainers/Naivic)

---

Top Contributors

[![Naivic](https://avatars.githubusercontent.com/u/180041625?v=4)](https://github.com/Naivic "Naivic (13 commits)")

---

Tags

curl

### Embed Badge

![Health badge](/badges/naivic-curl/health.svg)

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

###  Alternatives

[rmccue/requests

A HTTP library written in PHP, for human beings.

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

Lightweight HTTP client

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

A Readable, Chainable, REST friendly, PHP HTTP Client

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

Unirest PHP

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

PSR-18 and HTTPlug Async client with cURL

48247.0M384](/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)
