PHPackages                             hasanparasteh/async-request - 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. hasanparasteh/async-request

Abandoned → [saraf/async-request](/?search=saraf%2Fasync-request)Library[HTTP &amp; Networking](/categories/http)

hasanparasteh/async-request
===========================

Use async curl in reactphp project as easy as possible

0.1.5(3y ago)33.2k2MITPHPPHP &gt;=8.0.0CI failing

Since Dec 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/hasanparasteh/AsyncRequest)[ Packagist](https://packagist.org/packages/hasanparasteh/async-request)[ RSS](/packages/hasanparasteh-async-request/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (4)Versions (12)Used By (0)

Async HTTP Request [![CodeFactor](https://camo.githubusercontent.com/fc5cfa12f69e407a1a0ff5d1334e64293885c7c0dcdc750b4bfb6318d0045641/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f686173616e70617261737465682f6173796e63726571756573742f6261646765)](https://www.codefactor.io/repository/github/hasanparasteh/asyncrequest)
========================================================================================================================================================================================================================================================================================================================================================================

[](#async-http-request-)

This package will help you to send any request to any server in an asynchronous way! Just follow the instructions in order to install and setup the async curl package.

```
> composer require hasanparasteh/async-request
```

Quickstart Example
------------------

[](#quickstart-example)

This is the simplest way to do a `GET` request. The results will be in a callable function which has 3 major data in it.

1. result: `bool`=&gt; represent that curl is successful or not
2. code: `int`=&gt; http status code
3. body: `array`=&gt; json decoded array which server returned
4. error: `string`=&gt; description of the curl error

```
$request = new AsyncRequest("https://reqres.in");
$request->get("/api/users", ["page" => 2])->then(function ($result) {
    if (!$result['result'])
        echo "Curl Error cause {$result['error']}";
    else
        switch ($result['code']) {
            case 200:
                echo "Server Response 200 With " . json_encode($result['body'], 128);
                break;
            case 400:
                echo "Server Response 400";
                break;
            case 500:
                echo "Server Response 500";
                break;
            // .. and any other response Code
        }
});
```

### GET

[](#get)

if you need to pass any query params just sends the as an array to the second argument and if you need to add any header just pass it in the third argument as an array.

```
$request->get("endpoint")
```

### POST

[](#post)

It's just like the `GET` request but it sends the paramethers as a json encoded raw!

```
$request->get("endpoint", ['paramName' => 'paramValue' ], ['headerName'=>'headerValue']);
```

### PUT

[](#put)

It's exactly like the `POST`.

```
$request->put("endpoint")
```

### PATCH

[](#patch)

It's exactly like the `POST`.

```
$request->patch("endpoint")
```

### DELETE

[](#delete)

It's exactly like the `POST`.

```
$request->delete("endpoint")
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.3% 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 ~54 days

Recently: every ~72 days

Total

11

Last Release

1127d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/42239446?v=4)[Hasan Parasteh](/maintainers/hasanparasteh)[@hasanparasteh](https://github.com/hasanparasteh)

---

Top Contributors

[![hasanparasteh](https://avatars.githubusercontent.com/u/42239446?v=4)](https://github.com/hasanparasteh "hasanparasteh (21 commits)")[![yaldamahmoodi](https://avatars.githubusercontent.com/u/112390126?v=4)](https://github.com/yaldamahmoodi "yaldamahmoodi (2 commits)")

---

Tags

curlguzzlephp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hasanparasteh-async-request/health.svg)

```
[![Health](https://phpackages.com/badges/hasanparasteh-async-request/health.svg)](https://phpackages.com/packages/hasanparasteh-async-request)
```

###  Alternatives

[ccxt/ccxt

A cryptocurrency trading API with more than 100 exchanges in JavaScript / TypeScript / Python / C# / PHP / Go

43.2k341.0k1](/packages/ccxt-ccxt)[discord-php/http

Handles HTTP requests to Discord servers

24360.3k12](/packages/discord-php-http)[clue/soap-react

Simple, async SOAP webservice client library, built on top of ReactPHP

64123.7k2](/packages/clue-soap-react)[rx/websocket

Websockets for PHP using Rx

35182.6k2](/packages/rx-websocket)[php-http/react-adapter

React HTTP Adapter

19267.7k4](/packages/php-http-react-adapter)[voryx/websocketmiddleware

WebSocket Middleware for React

2669.4k3](/packages/voryx-websocketmiddleware)

PHPackages © 2026

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