PHPackages                             romeoz/rock-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. romeoz/rock-request

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

romeoz/rock-request
===================

HTTP request library for PHP

0.14.3(10y ago)01.6k4MITPHPPHP &gt;=5.4.0

Since Feb 16Pushed 10y ago1 watchersCompare

[ Source](https://github.com/romeOz/rock-request)[ Packagist](https://packagist.org/packages/romeoz/rock-request)[ RSS](/packages/romeoz-rock-request/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (20)Used By (4)

A simple HTTP request library for PHP
=====================================

[](#a-simple-http-request-library-for-php)

[![Latest Stable Version](https://camo.githubusercontent.com/e971ecfd030be13ee5558c255324e80cc824f66a22ebb191de1c9aa5e2957238/68747470733a2f2f706f7365722e707567782e6f72672f726f6d654f7a2f726f636b2d726571756573742f762f737461626c652e737667)](https://packagist.org/packages/romeOz/rock-request)[![Total Downloads](https://camo.githubusercontent.com/56e516b283f190c2586e05278802459ee5377f6a5cd8f013668dd2b7d237dcec/68747470733a2f2f706f7365722e707567782e6f72672f726f6d654f7a2f726f636b2d726571756573742f646f776e6c6f6164732e737667)](https://packagist.org/packages/romeOz/rock-request)[![Build Status](https://camo.githubusercontent.com/d64c04a3383f008355c2aa3bc3a209c32388bb6805e193784645c9efda313eb2/68747470733a2f2f7472617669732d63692e6f72672f726f6d654f7a2f726f636b2d726571756573742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/romeOz/rock-request)[![HHVM Status](https://camo.githubusercontent.com/fd3aea88bb163f4cca82c04e38d5beaa4400f307937c60984e496c7ee627a930/687474703a2f2f6868766d2e683463632e64652f62616467652f726f6d656f7a2f726f636b2d726571756573742e737667)](http://hhvm.h4cc.de/package/romeoz/rock-request)[![Coverage Status](https://camo.githubusercontent.com/ce88556529e3ed8b3dcf005e330dbc10318a49d28bc85069fc97f72798854a4b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f726f6d654f7a2f726f636b2d726571756573742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/romeOz/rock-request?branch=master)[![License](https://camo.githubusercontent.com/d907d0bc1f2e3c578499f9d73ca4b7b66adb41ac7c1a1514faa261a1c902c031/68747470733a2f2f706f7365722e707567782e6f72672f726f6d654f7a2f726f636b2d726571756573742f6c6963656e73652e737667)](https://packagist.org/packages/romeOz/rock-request)

Features
--------

[](#features)

- Sanitizing http-variables
- Standalone module/component for [Rock Framework](https://github.com/romeOz/rock)

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

[](#installation)

From the Command Line:

```
composer require romeoz/rock-request

```

In your composer.json:

```
{
    "require": {
        "romeoz/rock-request": "*"
    }
}
```

Quick Start
-----------

[](#quick-start)

```
use rock\request\Request;

// example url: http://site.com/foo/?page=1&foo[bar]=test

// returns relative URL
(new Request)->getUrl(); // output: /foo/?page=1&foo[bar]=test

// returns host
(new Request)->getHost(); // output: site.com

// returns query params
(new Request)->rawGet(); // output: ['page' => 1, 'foo' => ['bar' => 'test']]

// returns query params as multiple
(new Request)->rawGet(['foo', 'bar']); // output: test

// alternative approach
(new Request)->rawGet('foo.bar'); // output: test
```

\####Sanitize

For sanitizing http-variables required install [Rock Sanitize](https://github.com/romeOz/rock-sanitize): `composer require romeoz/rock-sanitize`.

```
use rock\sanitize\Sanitize;

// example url: http://site.com/foo/?page=-1

// default sanitize: Sanitize::removeTags()->trim()->toType();
Request::get('page'); // output: -1

// Add custom sanitize
Request::get('page', null, Sanitize::removeTags()->trim()->positive()); // output: 1
```

Requirements
------------

[](#requirements)

- **PHP 5.4+**
- For sanitizing http-variables required [Rock Sanitize](https://github.com/romeOz/rock-sanitize): `composer require romeoz/rock-sanitize`

> All unbolded dependencies is optional

License
-------

[](#license)

HTTP request library is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

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

Recently: every ~5 days

Total

19

Last Release

3830d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/23c5d84a59845d751cb69f5469986579b9312c54c898b366fefdc05baaa80a9c?d=identicon)[romeOz](/maintainers/romeOz)

---

Top Contributors

[![romeOz](https://avatars.githubusercontent.com/u/3135712?v=4)](https://github.com/romeOz "romeOz (59 commits)")

---

Tags

requesthttp request

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/romeoz-rock-request/health.svg)

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.0B3.2k](/packages/guzzlehttp-psr7)[psr/http-message

Common interface for HTTP messages

7.1k1.0B5.5k](/packages/psr-http-message)[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k692.9M1.9k](/packages/psr-http-factory)[fig/http-message-util

Utility classes and constants for use with PSR-7 (psr/http-message)

39489.0M274](/packages/fig-http-message-util)[nette/http

🌐 Nette Http: abstraction for HTTP request, response and session. Provides careful data sanitization and utility for URL and cookies manipulation.

48819.2M541](/packages/nette-http)[psr/http-server-handler

Common interface for HTTP server-side request handler

177101.3M921](/packages/psr-http-server-handler)

PHPackages © 2026

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