PHPackages                             ft/request-response - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. ft/request-response

AbandonedArchivedLibrary[DevOps &amp; Deployment](/categories/devops)

ft/request-response
===================

A library with common request response utils and helper methods

2.0.1(3y ago)1471MITPHPPHP &gt;=8.1

Since Aug 6Pushed 3y ago2 watchersCompare

[ Source](https://github.com/soulshined/ft-request-response)[ Packagist](https://packagist.org/packages/ft/request-response)[ RSS](/packages/ft-request-response/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (5)Versions (7)Used By (1)

Install
-------

[](#install)

`composer require ft/request-response`

Usage
-----

[](#usage)

### Requests

[](#requests)

```
$req = new Request;
```

That's it. A request automatically builds all things related to the current request based on `$_SERVER` and request method.

 ```
classDiagram
class Request {
  RequestHeaders $headers
  RequestMethods $method
  URL $url
  float $time
  object $parameters
  ?RequestBody $body
  ?string $ip
  AbstractUser $user
  string $protocol

  isPOST() bool
  isGET() bool
  isPUT() bool
  isPATCH() bool
  isDELETE() bool
  isHEAD() bool
  isTRACE() bool
  isCONNECT() bool
  isOPTIONS() bool
  isHTTPS() bool
  isHeaderSet(string $header) bool
  isHeaderSetAndNotEmpty(string $header) bool
  isParameterSet(string $name) bool
  isParameterSetAndNotEmpty(string $name) bool
  hasBody() bool
  containsErroneousParamaters(string ...$expecting) bool
}
```

      Loading All parameters are added to the request's `parameters` property *regardless* if they are query parameters or body parameters by way of multipart/form-data or www-form-urlencoded params. (Though, these are also added in the `body` property)

### Responses

[](#responses)

```
$resp = new Response();
```

`Response` is a builder-pattern class

Example:

```
$resp = new Response();
$resp->statusCode(StatusCodes::HTTP_VERSION_NOT_SUPPORTED)
     ->send();
```

Any time you call a `send*()` method of `Response` it will call `die()`

`Response` is content-type aware, for example, if you call the `sendJson()` method it will automatically set the content type header for you:

```
$array = [
    'foo' => 'bar'
];
$resp = new Response();
$resp->sendJson($array);
```

 ```
classDiagram
class Response {
  headers(array $headers = []) Response
  contentType(string $mediaType) Response
  statusCode(StatusCodes $code) Response
  statusCodePhrase(string $message) Response
  status(StatusCodes $code, ?string $message = null) Response
  content(mixed $content) Response
  redirect(string $url) never
  redirectIf(string $url, callable $predicate) never
  sendXML(string $xml) never
  sendJson(mixed $json) never
  sendHTML(string $html) never
  sendNoContent(?string $etag = null) never
  sendCreated(?string $uri = null) never
  sendAccepted() never
  sendNotFound(?string $message = null) never
  sendUnauthorized() never
  sendForbidden() never
  sendBadRequest() never
  sendInternalServerError() never
  send() never
}
```

      Loading

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

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

Recently: every ~15 days

Total

6

Last Release

1188d ago

Major Versions

1.1.3 → 2.0.02022-12-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a9ec50a967899163d0d22508c6e3b72b930f51e2d36213ac0bc782910ad46a2?d=identicon)[davidfreer](/maintainers/davidfreer)

---

Top Contributors

[![soulshined](https://avatars.githubusercontent.com/u/11242654?v=4)](https://github.com/soulshined "soulshined (15 commits)")

---

Tags

responserequestserver

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ft-request-response/health.svg)

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

###  Alternatives

[psr/http-server-handler

Common interface for HTTP server-side request handler

175101.3M921](/packages/psr-http-server-handler)[spatie/laravel-webhook-server

Send webhooks in Laravel apps

1.1k8.8M22](/packages/spatie-laravel-webhook-server)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[laminas/laminas-server

Create Reflection-based RPC servers

2423.1M23](/packages/laminas-laminas-server)[phpfastcgi/fastcgi-daemon

A FastCGI daemon written in PHP

33011.4k4](/packages/phpfastcgi-fastcgi-daemon)[phpfastcgi/speedfony-bundle

A bundle to integrate a FastCGI daemon with the symfony2 framework

909.5k](/packages/phpfastcgi-speedfony-bundle)

PHPackages © 2026

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