PHPackages                             pwm/sfw-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. pwm/sfw-request

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

pwm/sfw-request
===============

Simple Request for JSON APIs

1.0.1(8y ago)06.0k1MITPHPPHP &gt;=7.1.0

Since Apr 27Pushed 8y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (3)Used By (1)

SFW Request
===========

[](#sfw-request)

[![Build Status](https://camo.githubusercontent.com/c1d32cf0f0c174e305f94337a575ffa73272714e5c253e1534a08d9eb4892832/68747470733a2f2f7472617669732d63692e6f72672f70776d2f7366772d726571756573742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/pwm/sfw-request)[![codecov](https://camo.githubusercontent.com/d1bc4866dbfc8b3fb3598bbffeb7f2797fe1163f2345021a2510e092d2c2339c/68747470733a2f2f636f6465636f762e696f2f67682f70776d2f7366772d726571756573742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/pwm/sfw-request)[![Maintainability](https://camo.githubusercontent.com/4cc0c3986ff0eb4157034ee02582a410b928353c76020bb6ff0f67e94320908c/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f30613764323765653132663839656431306463652f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/pwm/sfw-request/maintainability)[![Test Coverage](https://camo.githubusercontent.com/ff2cc8034b0f38347398c94341b5a9350a447daf2c2977c9b1cfa28d09f475da/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f30613764323765653132663839656431306463652f746573745f636f766572616765)](https://codeclimate.com/github/pwm/sfw-request/test_coverage)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

A simple Request object for JSON APIs.

Table of Contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [How it works](#how-it-works)
- [Tests](#tests)
- [Changelog](#changelog)
- [Licence](#licence)

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

[](#requirements)

PHP 7.1+

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

[](#installation)

```
composer require pwm/sfw-request

```

Usage
-----

[](#usage)

```
// Create request
$request = new Request(
    new DateTimeImmutable(),
    $_SERVER['CONTENT_TYPE'],
    $_SERVER['REQUEST_METHOD'],
    $_SERVER['REQUEST_URI'],
    $_GET,
    file_get_contents('php://input')
);

// Access properties
$time = $request->getTime();
$contentType = $request->getContentType();
$method = $request->getMethod();
$uri = $request->getUri();
$query = $request->getQuery();
$json = $request->getJson();
```

How it works
------------

[](#how-it-works)

TBD

Tests
-----

[](#tests)

```
$ vendor/bin/phpunit
$ composer phpcs
$ composer phpstan

```

Changelog
---------

[](#changelog)

[Click here](changelog.md)

Licence
-------

[](#licence)

[MIT](LICENSE)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

2967d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/361d01dea838dfee1327e7c6e803e7f53ae92b48d6971bcaeca43d3d49504c19?d=identicon)[pwm](/maintainers/pwm)

---

Top Contributors

[![pwm](https://avatars.githubusercontent.com/u/195513?v=4)](https://github.com/pwm "pwm (13 commits)")

---

Tags

http-requestsfwhttp requestsfw

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pwm-sfw-request/health.svg)

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

###  Alternatives

[aura/http

The Aura HTTP package provides objects to build and send HTTP responses from the server to the client.

7338.8k4](/packages/aura-http)[causal/routing

Service to route HTTP/REST requests to your own controller/actions.

1919.9k](/packages/causal-routing)[popphp/pop-http

Pop Http Component for Pop PHP Framework

1018.5k13](/packages/popphp-pop-http)

PHPackages © 2026

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