PHPackages                             yvesnda/simple\_http - 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. yvesnda/simple\_http

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

yvesnda/simple\_http
====================

v1.0.0(8mo ago)06MITPHP

Since Sep 7Pushed 8mo agoCompare

[ Source](https://github.com/yvesnda/simple_http)[ Packagist](https://packagist.org/packages/yvesnda/simple_http)[ RSS](/packages/yvesnda-simple-http/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

simple\_http
============

[](#simple_http)

A simple PHP HTTP library with a single helper function for making HTTP requests.

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

[](#installation)

Install via [Composer](https://getcomposer.org/):

```
composer require yvesnda/simple_http
```

Usage
-----

[](#usage)

The library provides a single function: `http_request`.

```
require 'vendor/autoload.php';

// Example GET request
$response = http_request('GET', 'https://api.example.com/data');

// Example POST request with JSON data
$response = http_request('POST', 'https://api.example.com/data', [], ['key' => 'value']);

// Access response details
if ($response['error']) {
    echo "Error: " . $response['error'];
} else {
    echo "HTTP Code: " . $response['code'] . PHP_EOL;
    print_r($response['result']);
}
```

### Function Signature

[](#function-signature)

```
http_request($method, $url, $headers = [], $data = '', $follow_response_type = 1)
```

- **$method**: HTTP method (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`)
- **$url**: Request URL
- **$headers**: (optional) Array of headers
- **$data**: (optional) Array or string of data to send
- **$follow\_response\_type**: (optional) If `1`, tries to decode JSON/XML responses

### Response Structure

[](#response-structure)

The function returns an array with:

- `code`: HTTP status code
- `headers`: Request headers sent
- `raw`: Raw response body
- `result`: Parsed response (array for JSON, SimpleXMLElement for XML, or raw string)
- `error`: Error message if any

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance61

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

244d ago

### Community

Maintainers

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

---

Top Contributors

[![yvesnda](https://avatars.githubusercontent.com/u/44164396?v=4)](https://github.com/yvesnda "yvesnda (1 commits)")

### Embed Badge

![Health badge](/badges/yvesnda-simple-http/health.svg)

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

###  Alternatives

[friendsofsymfony/rest-bundle

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

2.8k73.3M318](/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.8M292](/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)
