PHPackages                             geronimo794/php-simple-curl-class - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. geronimo794/php-simple-curl-class

ActiveHelpers[Utility &amp; Helpers](/categories/utility)

geronimo794/php-simple-curl-class
=================================

Simple curl class helper

1.1.0(7y ago)35053[1 PRs](https://github.com/geronimo794/php-simple-curl-class/pulls)MITPHPPHP ^5.6.37 || ^7.0

Since Dec 10Pushed 4y ago2 watchersCompare

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

READMEChangelog (2)DependenciesVersions (3)Used By (0)

PHP Simple Curl Class
=====================

[](#php-simple-curl-class)

Version 1.0.0

Php class to make simple curl request. Can use as code igniter library or as php class.

Geting started
--------------

[](#geting-started)

### - As PHP Class

[](#--as-php-class)

[![PHP](https://github.com/geronimo794/php-simple-curl-class/raw/master/images/php-logo.png?raw=true)](https://github.com/geronimo794/php-simple-curl-class/blob/master/images/php-logo.png?raw=true)

**Step 1** : Download the curl class here [here](https://raw.githubusercontent.com/geronimo794/php-simple-curl-class/master/Curl.php)

**Step 2** : Include or require the curl class in your php file

```
require('Curl.php');
```

**Step 3** : Create object from curl class

```
$my_curl = new Curl();
```

**Step 4** : Set the url of curl request

```
$my_curl->setUrl('https://api.instagram.com/v1/media/shortcode/BLLZnwjAeEm');
```

**Step 5** : Set the GET/POST parameter to send via curl

```
$my_curl->setGetData('access_token', 'abxcsdfsdfasdasd');
$my_curl->setPostData('private_key', 'fgxftfsadfsadsad');
```

OR

```
$var_to_send = array(
    'access_token' => 'abxcsdfsdfasdasd',
    'private_key' => 'fgxftfsadfsadsad'
);
$my_curl->setGetData($var_to_send);
$my_curl->setPostData($var_to_send);
```

**Step 6** : Set the user\_agent of curl

```
$my_curl->setUserAgent('Maybe mozilla');
```

**Step 7** : Get the curl response

```
$curl_respon = $my_curl->getResponse();
```

### - As Code Igniter Library

[](#--as-code-igniter-library)

[![PHP](https://github.com/geronimo794/php-simple-curl-class/raw/master/images/code-igniter-logo.png?raw=true)](https://github.com/geronimo794/php-simple-curl-class/blob/master/images/code-igniter-logo.png?raw=true)

**Step 1** : Download the curl class here [here](https://raw.githubusercontent.com/geronimo794/php-simple-curl-class/master/Curl.php)

**Step 2** : Put the class file to Code Igniter library [![Getting Started 1](https://github.com/geronimo794/php-simple-curl-class/raw/master/images/getting-started-1.jpg?raw=true)](https://github.com/geronimo794/php-simple-curl-class/blob/master/images/getting-started-1.jpg?raw=true)

**Step 3** : Load curl library in your controller

```
$this->load->library('curl');
```

**Step 4** : Set the url of curl request

```
$this->curl->setUrl('https://api.instagram.com/v1/media/shortcode/BLLZnwjAeEm');
```

**Step 5** : Set the GET/POST parameter to send via curl

```
$this->curl->setGetData('access_token', 'abxcsdfsdfasdasd');
$this->curl->setPostData('private_key', 'fgxftfsadfsadsad');
```

OR

```
$var_to_send = array(
    'access_token' => 'abxcsdfsdfasdasd',
    'private_key' => 'fgxftfsadfsadsad'
);
$this->curl->setGetData($var_to_send);
$this->curl->setPostData($var_to_send);
```

**Step 6** : Set the user\_agent of curl

```
$this->curl->setUserAgent('Maybe mozilla');
```

**Step 7** : Get the curl response

```
$curl_respon = $this->curl->getResponse();
```

Avaible methods
---------------

[](#avaible-methods)

- **clear()** : Clear all the given setting to curl object
- **setUrl( $url )** : Set the url of curl request
- **setUserAgent( $userAgent )** : Set useragent
- **setPostData( $name, $value )** : Set the post data
- **setPostData( array( $name =&gt; $value ) )** : Set the post data
- **setGetData( $name, $value )** : Set the get data
- **setGetData( array( $name =&gt; $value ) )** : Set the get data
- **getResponse()** : Get response from curl
- **setOption( array( CURL\_OPT =&gt; CURL\_OPT\_VAL ) )** *(06-12-2016)* : Set the additional value for curl options with array
- **setOption( CURL\_OPT, CURL\_OPT\_VAL )** *(06-12-2016)* : Set the additional value for curl options with single option and value New method Version 1.2.0
- **setHeaderData( array( $name =&gt; $value ) )** : Set header data for the curl request with array
- **setHeaderData( $name, $value )** : Set header data for the curl request with name and value of header data
- **setBody( $requestBody )** : Set the body of the curl request, it's usefull when you want to send json data through request body
- **setRequestMethod( $requestMethod )** : Set curl request method it can be GET, POST, PUT, DELETE
- **getInstance()** : Get the current instance of the curl for the multiple curl request
- **getResponseMultiInit( $curlInstance = \[\] )** : Its use for curl multiple instance initiation request, so you can multiple curl request at once

Changelogs
----------

[](#changelogs)

Version 1.0.0

- setData, setUrl, setUserAgent, clear, getResponse.

Version 1.0.1 *(06-12-2012)*

- Add new method setOption.

Version 1.2.0 *(24-03-2018)*

- Add new method setHeaderData, setBody, setRequestMethod, getInstance, and getResponseMultiInit.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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

Total

2

Last Release

2695d ago

### Community

Maintainers

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

---

Top Contributors

[![geronimo794](https://avatars.githubusercontent.com/u/7543729?v=4)](https://github.com/geronimo794 "geronimo794 (14 commits)")

### Embed Badge

![Health badge](/badges/geronimo794-php-simple-curl-class/health.svg)

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

###  Alternatives

[maartenstaa/glicko2

PHP implementation of the Glicko-2 rating algorithm

147.3k](/packages/maartenstaa-glicko2)[jameslkingsley/laravel-references

Drop-in model references.

131.7k](/packages/jameslkingsley-laravel-references)

PHPackages © 2026

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