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

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

hxgf/http-request
=================

PHP functions to handle sending and receiving HTTP requests with CURL.

1.2.0(3y ago)146[10 issues](https://github.com/jyoungblood/http-request/issues)2MITPHP

Since May 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jyoungblood/http-request)[ Packagist](https://packagist.org/packages/hxgf/http-request)[ Docs](https://github.com/hxgf/http-request)[ RSS](/packages/hxgf-http-request/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (2)

[![](https://raw.githubusercontent.com/jyoungblood/vphp.dev/refs/heads/master/public/vphp-logo-100.png)](https://vphp.dev)

HTTP Request
============

[](#http-request)

Vanilla PHP functions to handle sending and receiving HTTP requests with CURL. This is a set of thin abstractions over a typical CURL request workflow with configurable options.

Installation
============

[](#installation)

Easy install with composer:

```
composer require jyoungblood/http-request

```

```
use VPHP\http;
require __DIR__ . '/vendor/autoload.php';
```

Usage
=====

[](#usage)

http::request($url, $parameters)
--------------------------------

[](#httprequesturl-parameters)

Makes an http request to a given url, sending an array of data and returning the raw response.

```
$api_data = http::request('https://external-api.com/v3/example-response', [
  'method' => 'POST', // optional, GET by default, GET and POST supported currently
  'json_decode' => true, // optional, returns an expected JSON response as a PHP array
  'debug' => true, // optional, returns all request information from curl_getinfo()
  'headers' => [ // optional, define any custom header
    'Cache-Control' => 'no-cache',
    'Content-Type' => 'application/json',
  ],
  'data' => [ // optional, will be submitted as querystring (GET) or FormData (POST)
    'user_id' => 581146,
    'api_key' => '696719xvckvzxspigh24y1e-b'
  ]
]);
```

http::get($url, $parameters)
----------------------------

[](#httpgeturl-parameters)

Alias to `http::request` using the default `GET` method.

```
$api_data = http::get('https://external-api.com/v3/example-response', [
  'data' => [
    'user_id' => 581146,
    'api_key' => '696719xvckvzxspigh24y1e-b'
  ]
]);
```

Everything in the the 'data' array will be submitted as a querystring. For example:

```
https://external-api.com/v3/example-response?user_id=581146&api_key=696719xvckvzxspigh24y1e-b
```

http::post($url, $parameters)
-----------------------------

[](#httpposturl-parameters)

Alias to `http::request` using the `POST` method.

```
$api_data = http::post('https://external-api.com/v3/example-response', [
  'data' => [
    'user_id' => 581146,
    'api_key' => '696719xvckvzxspigh24y1e-b'
  ]
]);
```

Everything in the 'data' array will be submitted as FormData.

http::json($url, $parameters)
-----------------------------

[](#httpjsonurl-parameters)

Alias to `http::request()` using the `json_decode` parameter (returns an expected JSON response as a PHP array)

```
$api_data = http::json('https://external-api.com/v3/example-response', [
  'data' => [
    'user_id' => 581146,
    'api_key' => '696719xvckvzxspigh24y1e-b'
  ]
]);
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

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

Total

4

Last Release

1208d ago

Major Versions

0.1.0 → 1.0.02022-05-20

### Community

Maintainers

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

---

Top Contributors

[![jyoungblood](https://avatars.githubusercontent.com/u/56104?v=4)](https://github.com/jyoungblood "jyoungblood (11 commits)")

---

Tags

curlhttp clientutilitieshttp-requests

### Embed Badge

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

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

###  Alternatives

[kriswallsmith/buzz

Lightweight HTTP client

2.0k31.3M440](/packages/kriswallsmith-buzz)[smi2/phpclickhouse

PHP ClickHouse Client

83510.1M71](/packages/smi2-phpclickhouse)[eightpoints/guzzle-bundle

Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony. Comes with easy and powerful configuration options and optional plugins.

45912.1M55](/packages/eightpoints-guzzle-bundle)[aplus/http-client

Aplus Framework HTTP Client Library

2161.6M1](/packages/aplus-http-client)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)[zoonman/pixabay-php-api

PixabayClient is a PHP HTTP client library to access Pixabay's API

3354.7k](/packages/zoonman-pixabay-php-api)

PHPackages © 2026

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