PHPackages                             syluxso/requiem - 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. syluxso/requiem

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

syluxso/requiem
===============

HTTP requests that are easy to use and extend.

142PHP

Since Apr 11Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Syluxso/Requiem)[ Packagist](https://packagist.org/packages/syluxso/requiem)[ RSS](/packages/syluxso-requiem/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Requiem
=======

[](#requiem)

INSTALL
-------

[](#install)

```
composer require syluxso/requiem

```

### GOAL

[](#goal)

- Make api calls that are simple to read and write.
- Simple implementation of defaults for setting headers, auth, etc.
- Access the response $status, $message, $data, $errors with ease.
- Permit for a platform specific drivers to be pre-configured for each api endpoint.

### CLASSES

[](#classes)

- Requiem: Example class to extend RequiemAPi
- RequiemApi: The main class drive them all.
- RequiemGuzzle: The class that consumes RequiemApi set up, implements Guzzle call, and returns the call through the RequiemResponse class.
- RequiemResponse: Takes the data from a $guzzle-&gt;getResponse() and processes it.
- Utils: Helper functions.

### REQUIREMENTS

[](#requirements)

- Requires Guzzle
- PHP 8.x

### EXAMPLE: Make calls

[](#example-make-calls)

```
// The most simple call
$r = new Requiem('https://api.test.com/get');
$r->call();

var_dump(
  $r->status(),  // 200
  $r->message(), // OK
  $r->data(),    // array|object of data response.
  $r->errors()  // null (unless there are errors.
);
```

```
// Add query params
$r = new Requiem('https://api.test.com/get');
$r->add_query('foo', 'bar'); // adds ?foo=bar to the request url string.
$r->call();
```

```
// Add headers
$r = new Requiem('https://api.test.com/get');
$r->add_header('Content-Type', 'application/json'); // Adds header.
$r->call();
```

```
// Change the request method
$r = new Requiem('https://api.test.com/get');
$r->method('post');
$r->call();
```

```
// Add body content
$r = new Requiem('https://api.test.com/get');
$r->add_body($array); // Array/Objects converted to json body.
$r->call();
```

```
// A few helpers
$r = new Requiem('https://api.test.com/get');
$r->basic_auth($user, $pass); // Simple basic auth.
$r->bearer_auth($token);
$r->use_json(); // This is added by default and adds the Content Type to the header.
$r->call();
```

```
// User $root and $routes
$r = new Requiem('/resource/endpoint');
$r->roote('https://api.test.com');
$r->call();
```

### EXAMPLE: Access the response &amp; errors.

[](#example-access-the-response--errors)

```
$r = new Requiem('https://api.test.com/get');
$r->call();
$status_code = $r->status(); // '200'
$status_message = $r->message(); // 'OK'
$response_data = $r->data(); // Array or Object body of the api response.
$errors = $r->errors(); // $error code(s)
```

### EXAMPLE: Extend with defaults

[](#example-extend-with-defaults)

```
class CustomPostRequiem {
  function __construct($route) {
    $this->root('https://api.myendpoing.com');
    $this->route($route);
    $this->method('post');
    $this->basic_auth(env('USER_ID', env('USER_PASS')));
    $this->add_query('api_token', env('API_TOKEN'));
  }
}

$r = new CustomPostRequiem('/my-route');
$r->call();

class CustomGetRequiem {
  function __construct($route) {
    $this->root('https://api.myendpoing.com');
    $this->route($route);
    $this->method('get');
    $this->basic_auth(env('USER_ID', env('USER_PASS')));
    $this->add_query('api_token', env('API_TOKEN'));
  }
}

$r = new CustomGetRequiem('/my-route');
$r->call();
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2285e4bc02c1132d05c9f7cd6b449cc39ff65b4a542578bb5f44a4e85eefa505?d=identicon)[Syluxso](/maintainers/Syluxso)

---

Top Contributors

[![Syluxso](https://avatars.githubusercontent.com/u/68607411?v=4)](https://github.com/Syluxso "Syluxso (10 commits)")

### Embed Badge

![Health badge](/badges/syluxso-requiem/health.svg)

```
[![Health](https://phpackages.com/badges/syluxso-requiem/health.svg)](https://phpackages.com/packages/syluxso-requiem)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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