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

ActiveLibrary

underdog1987/simple-curl
========================

A Basic PHP cURL client

011PHP

Since Nov 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/underdog1987/simple-curl)[ Packagist](https://packagist.org/packages/underdog1987/simple-curl)[ RSS](/packages/underdog1987-simple-curl/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

SimpleCURL
==========

[](#simplecurl)

SimpleCURL is a basic cURL client that can be used to consume REST services exposed by other apps.

Requisites
----------

[](#requisites)

- PHP 7.2 or higher
- curl extension enabled

Install
-------

[](#install)

Add SimpleCURL to your project vía composer

`composer require underdog1987/simple-curl`

Basic Usage
-----------

[](#basic-usage)

### Import class

[](#import-class)

To import SimpleCURL class use

```
use Underdog1987\SimpleCURL\SimpleCURL;
```

Linux systems are case-sensitive, that means, `SimpleCurl` and `SimpleCURL` are different class names. Be carreful.

### Simple GET request

[](#simple-get-request)

This example shows how to make a simple request to Google.

```
if(!SimpleCURL::isRunnable()){
   die('cURL extension is not loaded');
}
$client = new SimpleCURL();
$client->isGet();
$client->setUrl('https://google.com');
$client->ignoreCerts(TRUE);
$client->prepare();
$result = $client->execute();
print_r($result->getHttpCode()); // HTTP Response
print_r($result->getResponseHeaders()); // Response Headers
print_r($result->getResponseBody()); // Response Body
```

The `$client->isGet()` statement specifies GET as request method. The `$client->ignoreCerts(TRUE)` statement specifies SSL certificates will not be required in SSL connections (https).

### Simple POST request (form-data)

[](#simple-post-request-form-data)

This example shows how to make a simple POST request.

```
if(!SimpleCURL::isRunnable()){
   die('cURL extension is not loaded');
}
$client = new SimpleCURL();
$client->setData('name=John&surname=Doe');
$client->setUrl('http://example.com');
$client->prepare();
$result = $client->execute();
print_r($result->getHttpCode()); // HTTP Response
print_r($result->getResponseHeaders()); // Response Headers
print_r($result->getResponseBody()); // Response Body
```

By default, `SimpleCURL` request method is set to POST.

### Simple POST request (json)

[](#simple-post-request-json)

To send JSON as request body, just change the content of `setData()` and add header `Content-Type: application/json` as described below:

```
$client->setData('{"name":"Jhon", "surname":"Doe"}');
$client->addHeader(['name' => 'Content-Type', 'value' => 'appication/json']);
```

### Full documentation (WIP)

[](#full-documentation-wip)

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

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/eb6722c0f9e856227006fc394f4701aa2534b2ba460459e6e622c08e9dd2e93d?d=identicon)[underdog1987](/maintainers/underdog1987)

### Embed Badge

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

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

PHPackages © 2026

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