PHPackages                             allissonaraujo/sugardata - 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. allissonaraujo/sugardata

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

allissonaraujo/sugardata
========================

A simple Package to facilitate the use of requests with PHP

03PHP

Since Jul 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/allissonaraujo/sugardata)[ Packagist](https://packagist.org/packages/allissonaraujo/sugardata)[ RSS](/packages/allissonaraujo-sugardata/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

[![sugardata](https://private-user-images.githubusercontent.com/93150352/351423983-08012a49-0814-41c8-8ec0-18c1f6f66625.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODE1Mzc0MDYsIm5iZiI6MTc4MTUzNzEwNiwicGF0aCI6Ii85MzE1MDM1Mi8zNTE0MjM5ODMtMDgwMTJhNDktMDgxNC00MWM4LThlYzAtMThjMWY2ZjY2NjI1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA2MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNjE1VDE1MjUwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAwMDZlNmExYTE4ZTk3NGVjNmFhYjIzMzY2NDU4N2UwOGI2NTAwMzUxMWI5NmJmZDUxYjA2M2E4ZmM2ZmMwMzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.D6AO4SJBF58ZnPua4p2GZ-S6G3SCjiYepHkvIt0w30c)](https://private-user-images.githubusercontent.com/93150352/351423983-08012a49-0814-41c8-8ec0-18c1f6f66625.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODE1Mzc0MDYsIm5iZiI6MTc4MTUzNzEwNiwicGF0aCI6Ii85MzE1MDM1Mi8zNTE0MjM5ODMtMDgwMTJhNDktMDgxNC00MWM4LThlYzAtMThjMWY2ZjY2NjI1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA2MTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNjE1VDE1MjUwNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAwMDZlNmExYTE4ZTk3NGVjNmFhYjIzMzY2NDU4N2UwOGI2NTAwMzUxMWI5NmJmZDUxYjA2M2E4ZmM2ZmMwMzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.D6AO4SJBF58ZnPua4p2GZ-S6G3SCjiYepHkvIt0w30c)

A simple PHP package to send and receive HTTP requests using the cURL library.

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

[](#installation)

To install this package, use Composer:

```
composer require allissonaraujo/sugardata:dev-main
```

Usage
-----

[](#usage)

Sending a POST request ⬆️
-------------------------

[](#sending-a-post-request-️)

Here's a basic example of how to use the SugarData class to send a POST request:

```
require 'vendor/autoload.php';

use Allissonaraujo\SugarData\SugarData;

$url = 'https://jsonplaceholder.typicode.com/posts';
$data = [
    'title' => 'foo',
    'body' => 'bar',
    'userId' => 1
];

$request = new SugarData($url, $data);
$response = $request->send();

print_r($response);
```

Sending a GET Request ⬇️
------------------------

[](#sending-a-get-request-️)

### To send a GET request, you can specify the method as 'GET':

[](#to-send-a-get-request-you-can-specify-the-method-as-get)

```
require 'vendor/autoload.php';

use Allissonaraujo\SugarData\SugarData;

$url = 'https://jsonplaceholder.typicode.com/posts';
$data = [
    'userId' => 1
];

$request = new SugarData($url, $data, 'GET');
$response = $request->send();

print_r($response);
```

Sending a PUT Request 🔄
-----------------------

[](#sending-a-put-request-)

### Here's an example of how to send a PUT request:

[](#heres-an-example-of-how-to-send-a-put-request)

```
require 'vendor/autoload.php';

use Allissonaraujo\SugarData\SugarData;

$url = 'https://jsonplaceholder.typicode.com/posts/1';
$data = [
    'id' => 1,
    'title' => 'foo',
    'body' => 'bar',
    'userId' => 1
];

$request = new SugarData($url, $data, 'PUT');
$response = $request->send();

print_r($response);
```

Sending a DELETE Request ⛔
--------------------------

[](#sending-a-delete-request-)

### And here's how to send a DELETE request:

[](#and-heres-how-to-send-a-delete-request)

```
require 'vendor/autoload.php';

use Allissonaraujo\SugarData\SugarData;

$url = 'https://jsonplaceholder.typicode.com/posts/1';
$data = [];

$request = new SugarData($url, $data, 'DELETE');
$response = $request->send();

print_r($response);
```

###  Health Score

14

—

LowBetter than 1% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/93150352?v=4)[Allisson Araujo](/maintainers/allissonaraujo)[@allissonaraujo](https://github.com/allissonaraujo)

---

Top Contributors

[![allissonaraujo](https://avatars.githubusercontent.com/u/93150352?v=4)](https://github.com/allissonaraujo "allissonaraujo (18 commits)")

### Embed Badge

![Health badge](/badges/allissonaraujo-sugardata/health.svg)

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

###  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.4M91](/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)
