PHPackages                             valmaraz/php-network - 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. valmaraz/php-network

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

valmaraz/php-network
====================

Network - A lightweight library to send HTTP requests

v0.0.2(9y ago)117MITPHPPHP &gt;= 5.4

Since Jan 28Pushed 9y ago1 watchersCompare

[ Source](https://github.com/vAlmaraz/php-network)[ Packagist](https://packagist.org/packages/valmaraz/php-network)[ Docs](https://github.com/vAlmaraz/php-network)[ RSS](/packages/valmaraz-php-network/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

Network
=======

[](#network)

[![Packagist](https://camo.githubusercontent.com/d44f44b8f2f1c4ca2a882cf489ba98208ff3e44a4fdff358b1c535bb256d8769/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76416c6d6172617a2f7068702d6e6574776f726b2e737667)](https://packagist.org/packages/valmaraz/php-network) [![Packagist](https://camo.githubusercontent.com/2474f1b36499886c389812cd00b67d229a605afe820397b95fc6c653176b75ae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76416c6d6172617a2f7068702d6e6574776f726b2e737667)](https://packagist.org/packages/valmaraz/php-network) [![Packagist](https://camo.githubusercontent.com/a4b7a1d8377c4252b62962b12857454a352b488c7f58770dcbcadcffaf57247b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f646f637472696e652f6f726d2e737667)](https://packagist.org/packages/valmaraz/php-network)

Network is a lightweight library to send http requests.

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

[](#installation)

```
composer require vAlmaraz/php-network

```

Usage
-----

[](#usage)

```
use vAlmaraz\network\Network;

// Set URL and execute request
$response = Network::get($url)->execute();

// Retrieve response
echo $response->getBody();
```

Advanced Usage
--------------

[](#advanced-usage)

```
use vAlmaraz\network\Network;

$timeoutInSeconds = 3;
$headers = ['Accept' => 'application/json'];
$formData = ['field1' => 'value1', 'field2' => 'value2'];

// Configure request
$response = Network::post($url)
    ->setTimeoutInSeconds($timeoutInSeconds)
    ->withHeaders($headers)
    ->withFormData($formData)
    ->execute();

// Retrieve response info
echo $response->getStatusCode();
echo json_encode($response->getHeaders());
echo $response->getBody();
```

Examples
--------

[](#examples)

```
use vAlmaraz\network\Network;

$network = new Network();
// GET
$response = $network->get('https://jsonplaceholder.typicode.com/posts')
    ->execute();
// POST
$response = $network->post('https://jsonplaceholder.typicode.com/posts')
    ->withFormData(['title' => 'My title', 'body' => 'The body', 'userId' => 123])
    ->execute();
// PATCH
$response = $network->patch('https://jsonplaceholder.typicode.com/posts/1')
    ->withFormData(['title' => 'A new title'])
    ->execute();
// PUT
$response = $network->put('https://jsonplaceholder.typicode.com/posts/1')
    ->withFormData(['title' => 'My title', 'body' => 'The body', 'userId' => 123])
    ->execute();
// DELETE
$response = $network->delete('https://jsonplaceholder.typicode.com/posts/1')
    ->execute();

echo 'Status code: ' . $response->getStatusCode() . PHP_EOL . PHP_EOL;
echo 'Headers: ' . json_encode($response->getHeaders()) . PHP_EOL . PHP_EOL;
echo 'Body: ' . $response->getBody();
```

License
-------

[](#license)

This project is licensed under the MIT license. Please see the LICENSE file for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Total

2

Last Release

3393d ago

### Community

Maintainers

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

---

Top Contributors

[![vAlmaraz](https://avatars.githubusercontent.com/u/5544960?v=4)](https://github.com/vAlmaraz "vAlmaraz (6 commits)")

---

Tags

httprequestcurlnetwork

### Embed Badge

![Health badge](/badges/valmaraz-php-network/health.svg)

```
[![Health](https://phpackages.com/badges/valmaraz-php-network/health.svg)](https://phpackages.com/packages/valmaraz-php-network)
```

###  Alternatives

[aplus/http-client

Aplus Framework HTTP Client Library

2161.6M1](/packages/aplus-http-client)[pear/http_request2

Provides an easy way to perform HTTP requests.

764.2M48](/packages/pear-http-request2)[pdeans/http

PSR-7 cURL HTTP client with support for PSR-17 HTTP factories.

1466.2k3](/packages/pdeans-http)

PHPackages © 2026

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