PHPackages                             denniscarrazeiro/php-curl-module - 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. denniscarrazeiro/php-curl-module

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

denniscarrazeiro/php-curl-module
================================

A library that proposes handle curl php module. Consider that Module goes be use in PHP projects.

1.0.0(1y ago)00MITPHPPHP &gt;=7.2

Since May 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/denniscarrazeiro/php-curl-module)[ Packagist](https://packagist.org/packages/denniscarrazeiro/php-curl-module)[ Docs](https://github.com/denniscarrazeiro/)[ RSS](/packages/denniscarrazeiro-php-curl-module/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

PHP Curl Module
===============

[](#php-curl-module)

[![Maintainer](https://camo.githubusercontent.com/efc6f9a96627b72a38ee841220af7aa2329a212f469d3174d45579001cd6781f/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e7461696e65722d64656e6e697363617272617a6569726f2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://www.linkedin.com/in/dennis-carrazeiro)[![PHP from Packagist](https://camo.githubusercontent.com/6ddaaace66d99d435cd9ef91fc5853d3d188b94591f9d32ab88e7b579dc59ee9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f64656e6e697363617272617a6569726f2f7068702d6375726c2d6d6f64756c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/denniscarrazeiro/php-curl-module)[![Latest Version](https://camo.githubusercontent.com/dd71632fd6e3a609265aed110604e6fdf566f7f822f28ebbdcaf928c2e579ba0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f64656e6e697363617272617a6569726f2f7068702d6375726c2d6d6f64756c652e7376673f7374796c653d666c61742d737175617265)](https://github.com/denniscarrazeiro/php-curl-module/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

The Php Curl Module provides a robust and flexible way to perform HTTP requests within PHP applications, leveraging the power of the cURL extension. Through its intuitive fluent interface, developers can effortlessly configure a wide range of request options, including the target URL, custom HTTP headers, user agent, timeout settings, SSL verification preferences, data for POST requests, HTTP authentication credentials, and even define custom HTTP methods like PUT or DELETE. This class simplifies the process of interacting with web services and APIs, enabling seamless data retrieval and submission with granular control over the underlying HTTP communication.

Instalation
-----------

[](#instalation)

```
bash ./scripts/composer_install.sh
```

Composer is a dependency manager for the PHP programming language. Therefore, after running the command above, Composer will install all the necessary dependencies to ensure the project functions under the best possible conditions.

Unit Tests
----------

[](#unit-tests)

```
bash ./scripts/phpunit_tests.sh
```

PHPUnit is a programmer-oriented testing framework for PHP, designed to facilitate the creation and execution of unit tests. Consequently, after setting up your test suite and running the appropriate command, PHPUnit will execute your tests and provide detailed feedback, ensuring your codebase maintains a high level of quality and reliability.

#### Usage Example 1

[](#usage-example-1)

```
require 'Curl.php'; // Make sure to include the Curl class file

use DennisCarrazeiro\Php\Curl\Module\Curl\Curl;

$curl = new Curl();
$response = $curl->url('https://api.example.com/users')
                 ->returnTransfer(true) // Returns the response as a string
                 ->execute();

if ($curl->statusCode() === 200) {
    echo "Successful GET request!\n";
    // Process the response (usually in JSON)
    $data = json_decode($response, true);
    print_r($data);
} else {
    echo "GET request failed. Status code: " . $curl->statusCode() . "\n";
    if ($errors = $curl->getValidationsErrors()) {
        echo "Error details: " . implode(", ", $errors) . "\n";
    }
}
```

#### Usage Example 2

[](#usage-example-2)

```
require_once(__DIR__."/../vendor/autoload.php");

use \DennisCarrazeiro\Php\Curl\Module\Curl\Curl;

$data = [
    'name' => 'New User',
    'email' => 'new.user@example.com'
];
$jsonData = json_encode($data);

$curl = new Curl('application/json'); // Sets the Content-Type in the constructor
$response = $curl->url('https://api.example.com/users')
                 ->customRequest('POST') // Sets the method to POST
                 ->postFields($jsonData) // Sends the JSON data in the body
                 ->addHeader('X-API-Key: your_api_key') // Adds a custom header
                 ->returnTransfer(true)
                 ->execute();

if ($curl->statusCode() === 201) { // Status code 201 usually indicates successful creation
    echo "User created successfully!\n";
    $responseData = json_decode($response, true);
    print_r($responseData);
} else {
    echo "Error creating user. Status code: " . $curl->statusCode() . "\n";
    if ($errors = $curl->getValidationsErrors()) {
        echo "Error details: " . implode(", ", $errors) . "\n";
    }
}
```

More Examples
-------------

[](#more-examples)

For more examples see the [Examples](https://github.com/denniscarrazeiro/php-curl-module/blob/master/examples) folder.

License
-------

[](#license)

The MIT license. Please see [License file](https://github.com/denniscarrazeiro/php-curl-module/blob/master/LICENSE) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance48

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

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

Unknown

Total

1

Last Release

379d ago

### Community

Maintainers

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

---

Top Contributors

[![denniscarrazeiro](https://avatars.githubusercontent.com/u/5447197?v=4)](https://github.com/denniscarrazeiro "denniscarrazeiro (1 commits)")

---

Tags

curlCarrazeiro

### Embed Badge

![Health badge](/badges/denniscarrazeiro-php-curl-module/health.svg)

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

###  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

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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