PHPackages                             byancode/requestcurl - 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. byancode/requestcurl

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

byancode/requestcurl
====================

Multicurl Async

048PHP

Since May 28Pushed 4y ago1 watchersCompare

[ Source](https://github.com/byancode/requestcurl)[ Packagist](https://packagist.org/packages/byancode/requestcurl)[ RSS](/packages/byancode-requestcurl/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Async multi CURL deep recursive
===============================

[](#async-multi-curl-deep-recursive)

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

[](#installation)

You can install the package via composer:

```
composer require byancode/requestcurl
```

Usage
-----

[](#usage)

```
/***************************************************************************************
@param string   $method   = OPTIONS, GET, POST, PUT, PATCH, DELETE, HEAD, LINK, UNLINK
@param string   $url      = https://...
@param array    $fields   = [ "name" => "byancode" ] or null
@param array    $options  = [ CURLOPT_HTTPHEADER => [ "Accept" => "application/json" ] ]
***************************************************************************************/
$request->add(string $method, string $url, array $fields = null, array $options = [])
$request->get(string $url, array $fields = null, array $options = [])
// PROMESA
$request->get(...)->then(string|array|object $response, array $request_info)
$request->get(...)->catch(string|array|object $response, array $request_info, string|null $errorMessage)
$request->get(...)->finally(string|array|object $response, array $request_info)
```

Usage 2
-------

[](#usage-2)

```
# return string response
$request->get(...)->then(function($data) {
    if (gettype($data) === 'string') {
        echo 'si';
    } else {
        echo 'no';
    }
})->catch(function() {
    echo 'produced by error curl or http response error code';
});
# ----------
# output: si

# return response converted in array
$request->get(...)->then(function(array $data) {
    if (gettype($data) === 'array') {
        echo 'si';
    } else {
        echo 'no';
    }
})->catch(function(array $responseError) {
    # get error response converted in array (ideal for apis)
    echo 'produced by error curl or http response error code';
});
# ----------
# output: si

# return response converted in object
$request->get(...)->then(function(object $data) {
    if (gettype($data) === 'object') {
        echo 'si';
    } else {
        echo 'no';
    }
})->catch(function(array ) {
    echo 'produced by error curl or http response error code';
})->catch(function(): string {
    return 'replace response for this';
});
# ----------
# output: si
```

Example 1
---------

[](#example-1)

```
$request = new \Byancode\RequestCurl();

for ($i=0; $i < 16; $i++) {
    $request->post('https://www.php.net/manual/es/function.symlink.php')->then(function($response) {
        echo '1' . PHP_EOL;
        echo str_repeat('-', 20) . PHP_EOL;
        echo $response;
    });
    $request->add('GET', 'https://www.docker.com/get-started')->then(function($response) {
        echo '2' . PHP_EOL;
        echo str_repeat('-', 20) . PHP_EOL;
        echo $response;
    });
    $request->get('https://packagist.org/packages/pbmedia/laravel-ffmpeg')->then(function($response) {
        echo '3' . PHP_EOL;
        echo str_repeat('-', 20) . PHP_EOL;
        echo $response;
    });
}

$request->execute();
```

Example 2
---------

[](#example-2)

```
$request = new \Byancode\RequestCurl();

$request->add('GET', 'https://restcountries.eu/rest/v2/currency/cop')->then(function(array $response): string {
    return $response[0]['name'];
});

$request->get('https://restcountries.eu/rest/v2/currency/pen')->then(function(array $response): string {
    return $response[0]['name'];
});

$request->get('https://restcountries.eu/rest/v2/currency/mxn')->then(function(array $response): string {
    return $response[0]['name'];
});

$request->execute();

print_r($request->response);

/*
output:
--------------------
Array
(
    [0] => Colombia
    [1] => Peru
    [2] => Mexico
)
*/
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

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/37272486?v=4)[Byancode](/maintainers/byancode)[@byancode](https://github.com/byancode)

---

Top Contributors

[![byancode](https://avatars.githubusercontent.com/u/37272486?v=4)](https://github.com/byancode "byancode (28 commits)")

### Embed Badge

![Health badge](/badges/byancode-requestcurl/health.svg)

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

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

PHP ClickHouse Client

83510.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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