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(9mo ago)06MITPHP

Since Sep 7Pushed 9mo 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 today

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

27

—

LowBetter than 47% of packages

Maintenance55

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

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

299d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/44164396?v=4)[yvesnda](/maintainers/yvesnda)[@yvesnda](https://github.com/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

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M91](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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