PHPackages                             wilkques/http-client - 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. wilkques/http-client

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

wilkques/http-client
====================

http-client

v5.0.1(1y ago)03582MITPHPPHP &gt;=8.2

Since Jul 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/wilkques/http-client)[ Packagist](https://packagist.org/packages/wilkques/http-client)[ RSS](/packages/wilkques-http-client/feed)WikiDiscussions master Synced 1w ago

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

Http Client
===========

[](#http-client)

[![Latest Stable Version](https://camo.githubusercontent.com/18b0c747681a487ad05ef291041072eb1d9d1b5c0f2b99dca6cce268cafb9c93/68747470733a2f2f706f7365722e707567782e6f72672f77696c6b717565732f687474702d636c69656e742f762f737461626c65)](https://packagist.org/packages/wilkques/http-client)[![License](https://camo.githubusercontent.com/9911736d5cf6b3692d8aecd732988209180df5025c740d3966b4781379998829/68747470733a2f2f706f7365722e707567782e6f72672f77696c6b717565732f687474702d636c69656e742f6c6963656e7365)](https://packagist.org/packages/wilkques/http-client)

How to start
------------

[](#how-to-start)

```
composer require wilkques/http-client

```

How to use
----------

[](#how-to-use)

```
use Wilkques\Http\Http;
```

Methods
-------

[](#methods)

1. `setCurlOption` PHP CURL Setting

    ```
    $response = Http::setCurlOption(, );

        // Ex

    $response = Http::setCurlOption(CURLOPT_TIMEOUT, 100);
    ```
2. `withHeaders`

    ```
    $response = Http::withHeaders([ ... ]); // add header

    // Ex

    $response = Http::withHeaders([
        'Accept' => 'application/json; charset=utf-8'
    ]);
    ```
3. `setHeader`

    ```
    $response = Http::setHeader('', ''); // add header

    // Ex

    $response = Http::setHeader('Accept', 'application/json; charset=utf-8');
    ```
4. `asForm`

    ```
    $response = Http::asForm(); // add header application/x-www-form-urlencoded
    ```
5. `asJson`

    ```
    $response = Http::asJson(); // add header application/json
    ```
6. `asMultipart`

    ```
    $response = Http::asMultipart(); // add header multipart/form-data
    ```
7. `attach`

    ```
    $response = Http::attach('', '', '', ''); // add file
    ```
8. `get`

    ```
    $response = Http::get('', [ ... ]); // Http method get
    ```
9. `post`

    ```
    $response = Http::post('', [ ... ]) // Http method post
    ```
10. `put`

    ```
    $response = Http::put('', [ ... ]) // Http method put
    ```
11. `patch`

    ```
    $response = Http::patch('', [ ... ]) // Http method patch
    ```
12. `delete`

    ```
    $response = Http::delete('', [ ... ]) // Http method delete
    ```
13. `status`

    ```
    $response->status(); // get http status code
    ```
14. `body`

    ```
    $response->body(); // get body
    ```
15. `json`

    ```
    $response->json(); // get json_decode body
    ```
16. `headers`

    ```
    $response->headers(); //get headers
    ```
17. `header`

    ```
    $response->header(''); // get header
    ```
18. `ok`

    ```
    $response->ok(); // bool
    ```
19. `redirect`

    ```
    $response->redirect(); // bool
    ```
20. `successful`

    ```
    $response->successful(); // bool
    ```
21. `failed`

    ```
    $response->failed(); // bool
    ```
22. `clientError`

    ```
    $response->clientError(); // bool
    ```
23. `serverError`

    ```
    $response->serverError(); // bool
    ```
24. `throw`

    ```
    $response->throw(); // throw exception

    // or

    $response->throw(new \Exception('', ''));

    // or

    $response->throw(function ($response, $exception) {
        // code
        // return exception
    });
    ```
25. `pool`

    ```
    $response = \Wilkques\Http\Http::Pool(function (\Wilkques\Http\Pool $pool) {
        return [
            $pool->get('http://example.com/get', ['abc' => 123]),
            $pool->post('http://example.com/post', ['def' => 456]),
            $pool->as('get')->get('http://example.com/get', ['ghi' => 789]),
            $pool->as('post')->post('http://example.com/post', ['jkl' => 012]),
        ];
    }, [
        'response'  => [
            'sort'  => true, // response sort, default true
        ],
        'timeout'   => 100, // timeout microseconds suggest < 1 sec, default 100
        // success
        'fulfilled' => function (\Wilkques\Http\Response $response, $index) {
            var_dump($index); // array index
            var_dump($response); // \Wilkques\Http\Response

            return $response;
        },
        // fail
        'rejected' => function (\Wilkques\Http\Exceptions\CurlExecutionException $exception, $index) {
            var_dump($index); // array index
            var_dump($exception); // \Wilkques\Http\Exceptions\CurlExecutionException

            return $response;
        },
        'options'   => [
            // curl_multi_setopt option & value ...
        ]
    ]);

    // output
    // array(
    //    '0'       => Wilkques\Http\Response...,
    //    '1'       => Wilkques\Http\Response...,
    //    'get'     => Wilkques\Http\Response...,
    //    'post'    => Wilkques\Http\Response...,
    // )
    var_dump($response);

    $response[0]->failed();

    $response[1]->successful();

    // etc ...
    ```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance45

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity71

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

Recently: every ~260 days

Total

12

Last Release

423d ago

Major Versions

v0.1.4 → v1.0.02022-03-10

v1.1.3 → v4.0.02023-07-25

v4.1.0 → v5.0.12025-03-21

PHP version history (2 changes)v0.0.0PHP &gt;=7.0

v5.0.1PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/906e907ec7e3dbe49f32aebd0f36488176d3736a65d38675753ba9a6a21017b6?d=identicon)[wilkques](/maintainers/wilkques)

---

Top Contributors

[![wilkques](https://avatars.githubusercontent.com/u/51186879?v=4)](https://github.com/wilkques "wilkques (29 commits)")

### Embed Badge

![Health badge](/badges/wilkques-http-client/health.svg)

```
[![Health](https://phpackages.com/badges/wilkques-http-client/health.svg)](https://phpackages.com/packages/wilkques-http-client)
```

###  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)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

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

78126.4M414](/packages/react-http)

PHPackages © 2026

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