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

ActiveLibrary

neoan3-apps/curl
================

neoan3 curl class

1.0.1(6y ago)03092MITPHP

Since Nov 10Pushed 6y agoCompare

[ Source](https://github.com/sroehrl/neoan3-curl)[ Packagist](https://packagist.org/packages/neoan3-apps/curl)[ RSS](/packages/neoan3-apps-curl/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (1)Versions (8)Used By (2)

[![Build Status](https://camo.githubusercontent.com/6eb6f32f28eae03e8d5ac42d151e0f87b4c95c2ea3452dfe9a7fd984c27d8a05/68747470733a2f2f7472617669732d63692e636f6d2f73726f6568726c2f6e656f616e332d6375726c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/sroehrl/neoan3-curl)[![Maintainability](https://camo.githubusercontent.com/e05bfb1cdbfd42b44cc5e89f3f01a173946f2303dbca8e92a90beda6a847a36b/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f38633238353833396631653064346132653438352f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/sroehrl/neoan3-curl/maintainability)[![Test Coverage](https://camo.githubusercontent.com/493bd0e34164b16a8280c413441dcda0b4c0f24cc74c6954a610aafcf9416ff0/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f38633238353833396631653064346132653438352f746573745f636f766572616765)](https://codeclimate.com/github/sroehrl/neoan3-curl/test_coverage)

Simple PHP curl wrapper
=======================

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

This lightweight curl wrapper facilitates most common needs and is designed for server-2-server communication for Oauth flows, APIs using JSON responses and alike.

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

[](#installation)

`composer require neoan3-apps/curl`

Quick start
-----------

[](#quick-start)

Json responses are automatically decoded to associative arrays.

```
try{
    $comments = \Neoan3\Apps\Curl::get('https://jsonplaceholder.typicode.com/posts/1/comments');
} catch (CurlException $e){
    echo $e->getMessage();
}

/* output
* [
*   ['postId' => 1, 'name' => 'labore ...']
*   [...]
* ]
*
*/
```

Simplified calls
----------------

[](#simplified-calls)

### get($url, $array = \[\], $auth = false, $authType = 'Bearer')

[](#geturl-array---auth--false-authtype--bearer)

*NOTE:* $array is converted to GET parameters

### post($url, $array = \[\], $auth = false, $authType = 'Bearer')

[](#posturl-array---auth--false-authtype--bearer)

### put($url, $array = \[\], $auth = false, $authType = 'Bearer')

[](#puturl-array---auth--false-authtype--bearer)

These calls are most common and can either be used with or without authorization. If $auth is set, the methods assume a Baerer token.

curling($url, $arrayOrBody, $header, $type = 'POST')
----------------------------------------------------

[](#curlingurl-arrayorbody-header-type--post)

Custom call where the header is set manually as an array and the method defaulting to POST

setResponseFormatVerbose()
--------------------------

[](#setresponseformatverbose)

The class defaults to "plain" output only containing the payload of the response. this method changes the behavior to return responses in the following format:

```
[
    'headers' => $headers, // array
    'body' => $responseBody, // array
    'status' => $status // int (e.g.200)
];
```

When switching between output formats, use **setResponseFormatPlain()** to reset behavior.

Exceptions
----------

[](#exceptions)

CurlException is only thrown if responses are 500 &amp; above. This means that a 404 **is a valid call** and evaluation of usefulness should be done elsewhere.

*SECURITY*: While I am sure your vendor-folder is probably already protected, neoan3-curl protects the \_log folder with an .htaccess file. Should you not use Apache and your vendor folder is visible, please take steps to secure the folder vendor/neoan3-apps/curl/\_log

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

4

Last Release

2345d ago

Major Versions

0.0.3 → 1.0.02019-12-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/92d2361b646651e3452a62d07274076346c4096480098a6c43d6c27ee28d460d?d=identicon)[neoan](/maintainers/neoan)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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