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

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

ramapriya/http-request
======================

small library for work with http requests

023PHP

Since May 1Pushed 6y ago1 watchersCompare

[ Source](https://github.com/stayfuneral/httprequest)[ Packagist](https://packagist.org/packages/ramapriya/http-request)[ RSS](/packages/ramapriya-http-request/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

HtttpRequest
============

[](#htttprequest)

Small PHP-SDK library for work with HTTP requests

### Installation

[](#installation)

Add dependency in composer.json

```
"require": {
    "ramapriya/http-request": "dev-master"
}
```

Evoke autoload file after installation or updating composer

```
require __DIR__ . "/vendor/autoload.php";
```

All methods are static, don't need create new class object

### Methods

[](#methods)

*`GetRequestMethod()`* get request method:

```
$method = Request::GetRequestMethod();

switch($method) {
    case 'GET':
        // your code
        break;
    case 'POST':
        // your code
        break;
}
```

#### GET

[](#get)

*`isGet()`* check GET

```
if(Request::isGet()!== false) {
    $name = htmlspecialchars(Request::Get('name'));
}
```

*`Get($param = null)`* get global `$_GET`. If `$param` isn't null, method returns value of param - `$_GET["param"]`, else - object `$_GET`

```
if(!empty(Request::Get('email'))) {
    $email = htmlspecialchars(Request::Get('email'));
}
```

*`GetParams()`* get all keys of `$_GET`, method returns array of keys

```
if(!in_array('user_id', Request::GetParams)) {
    echo json_encode("User ID isn't defined!");
}
```

#### POST

[](#post)

*`isPost()`* check POST

*`Post($param = null)`* get global `$_POST`. If `$param` isn't null, method returns value of param - `$_POST["param"]`, else - object `$_POST`

*`PostParams`* get all keys of `$_POST`, method returns array of keys

#### Raw requests (php://input)

[](#raw-requests-phpinput)

Before:

```
$json = file_get_contents("php://input");
$request = json_decode($json);

if(!empty($request)) {
    // your code
}
```

Now:

```
if(Request::isRaw()) {
    $request = Request::Raw();
}
```

*`isRaw()`* check raw request

*`Raw($param = null)`* get decoded raw request. If `$param` isn't null, method returns value of param, else - decoded json

*`RawParams`* get all keys of `GetRawParams()`, method returns array of keys

#### Headers

[](#headers)

*`GetAllHeaders()`* get all headers of request, method returns array

```
$headers = Request::GetAllHeaders();
```

*`GetHostName()`* method returns host name

```
$domain = Request::GetHostName();
```

*`isHttps()`* check HTTPS

```
if(Request::isHttps() !== true) {
    die("Application works only with HTTPS!");
}
```

*`GetUserAgent()`* method returns User-Agent

```
$userAgent = Request::GetUserAgent();
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d7597ecaf578bcc5246f915611df4319f25b83bc8d51144e874ffe4c19711adf?d=identicon)[Roman Gonyukov](/maintainers/Roman%20Gonyukov)

### Embed Badge

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

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

###  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.8k](/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.4M90](/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)
