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

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

sfadless/http
=============

Small library for get/post requests

2.0(8y ago)047PHPPHP &gt;=5.4

Since Sep 21Pushed 8y agoCompare

[ Source](https://github.com/sfadless/http)[ Packagist](https://packagist.org/packages/sfadless/http)[ RSS](/packages/sfadless-http/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (5)DependenciesVersions (7)Used By (0)

HTTP small library for get/post requests
========================================

[](#http-small-library-for-getpost-requests)

Documentation
-------------

[](#documentation)

### Instalation

[](#instalation)

```
composer require Sfadless/http

```

### Usage

[](#usage)

#### Basic usage

[](#basic-usage)

```
use Sfadless\Utils\Http\Http;

require_once __DIR__ . '/vendor/autoload.php';

$http = new Http();

$response = $http->get('http://some.url');
$response = $http->post('http://some.url');
```

#### Usage with params and headers

[](#usage-with-params-and-headers)

```
use Sfadless\Utils\Http\Http;

require_once __DIR__ . '/vendor/autoload.php';

$http = new Http();

$params = [
    'param1' => 'value',
    'param2' => 'value2'
];

$headers = [
    'header1' => 'value',
    'header2' => 'value'
];

$response = $http->post('http://some.url', $params, $headers);
```

#### Request and response formats

[](#request-and-response-formats)

By default, response value is string and request value is array. If your service always return specific format (for example - json), you may pass those formats in constructor

```
use Sfadless\Utils\Http\Http;
use Sfadless\Utils\Http\Format\Request\ArrayRequestFormat;
use Sfadless\Utils\Http\Format\Response\JsonResponseFormat;

$http = new Http(
    new ArrayRequestFormat(), //instanse of RequestFormatInterface, used by default
    new JsonResponseFormat(), //instanse of ResponseFormatInterface, response value will be passed throught getFormattedResponse method
);
```

You may create your own formats for request and response by implementing RequestFormatInterface and ResponseFormatInterface. In request, you should create formatParams() method, in which will be passed $params (second argument for -&gt;post() and -&gt;get() methods), and return value for stream context option. For response format, you should implement getFormattedResponse() method, this is the layer between response from server and you code.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

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

Recently: every ~3 days

Total

6

Last Release

3012d ago

Major Versions

1.2.x-dev → 2.02018-02-14

PHP version history (2 changes)1.0PHP ^5.4 || &gt;=7.0.8

1.1PHP &gt;=5.4

### Community

Maintainers

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

---

Top Contributors

[![sfadless](https://avatars.githubusercontent.com/u/20106153?v=4)](https://github.com/sfadless "sfadless (3 commits)")

### Embed Badge

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

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

###  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)
