PHPackages                             dbeurive/slim-requester - 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. dbeurive/slim-requester

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

dbeurive/slim-requester
=======================

This package contains a tool that allows you to perform requests to your Slim application by bypassing the WEB server.

1.0.2(9y ago)0161Creative Commons Attribution 4.0 International Public LicensePHP

Since Jan 10Pushed 9y ago1 watchersCompare

[ Source](https://github.com/dbeurive/slim-requester)[ Packagist](https://packagist.org/packages/dbeurive/slim-requester)[ RSS](/packages/dbeurive-slim-requester/feed)WikiDiscussions master Synced today

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

- [Introduction](#a0)
- [License](#a1)
- [Installation](#a2)
- [Synopsis](#a3)
- [API](#a4)
- [Examples](#a5)

Introduction
==========================================

[](#introduction)

This package contains a "requester" the [Slim framework](https://www.slimframework.com/).

The requester allows you to perform requests over your Slim application without the need for a WEB server. This is particularly useful when you want to automate unit tests. Indeed, while you are unit-testing your application's logic, you don't want to test the WEB server's configuration.

> Please note that this package is a work in progress, since new features will be added.

License
=====================================

[](#license)

This code is published under the following license:

[Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/legalcode)

See the file [LICENSE.TXT](LICENSE.TXT)

Installation
==========================================

[](#installation)

From the command line:

```
composer require dbeurive/slim-requester

```

Or, from within the file `composer.json`:

```
"require": {
    "dbeurive/slim-requester": "*"
}

```

Synopsis
======================================

[](#synopsis)

Create a the Slim application:

```
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use dbeurive\Slim\Requester;

// Create your Slim application

$configuration = array(/* your configuration */);
$application = new \Slim\App($configuration);

$application->get('/get/{name}', function (Request $request, Response $response) {
    $name = $request->getAttribute('name');
    $response->getBody()->write("Hello, $name");
    return $response;
});

$application->post('/post', function (Request $request, Response $response) {
    $data = $request->getParsedBody();
    $firstName = filter_var($data['firstname'], FILTER_SANITIZE_STRING);
    $lastName  = filter_var($data['lastname'], FILTER_SANITIZE_STRING);
    $response->getBody()->write("Hello, $firstName $lastName");
    return $response;
});

// Create the requester

$requester = new Requester($application);

// And then you can perform requests:

$text = $requester->get('/get/toto');
$parameters = ['firstname' => 'Mickey', 'lastname' => 'Mouse'];
$text = $requester->post('/post', $parameters);
$response = $requester->getResponse();
```

API
=================================

[](#api)

```
\dbeurive\Slim\Requester::__construct(App $inApplication)
\dbeurive\Slim\Requester::get($inRequestUri, $inQueryString='')
\dbeurive\Slim\Requester::post($inRequestUri, $inPostParameters=[])
\dbeurive\Slim\Requester::jsonRpc($inRequestUri, $inParameters=[])
\dbeurive\Slim\Requester::setServerCgiEnvironmentVariables(array $inServerCgiEnvironmentVariables, $inMerge=false)
\dbeurive\Slim\Requester::setHttpHeaders(array $inHttpHeaders, $inMerge=false)
\dbeurive\Slim\Requester::getResponse()
\dbeurive\Slim\Requester::getRequest()

```

Please see the file [Requester.php](src/Requester.php) for a detailed description of the API.

Examples
======================================

[](#examples)

Please see the unit tests for examples.

The file below creates the application:

- [index.php](tests/www/index.php): this file is the application's entry point.

The three files below implement unit tests:

- [AppInit.php](tests/actions/AppInit.php): this file creates the application and initializes the requester.
- [GetTest.php](tests/actions/GetTest.php)
- [JsonRpcTest.php](tests/actions/JsonRpcTest.php)
- [PostTest.php](tests/actions/PostTest.php)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

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

Total

3

Last Release

3454d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18211524?v=4)[Denis BEURIVE](/maintainers/dbeurive)[@dbeurive](https://github.com/dbeurive)

---

Top Contributors

[![dbeurive](https://avatars.githubusercontent.com/u/18211524?v=4)](https://github.com/dbeurive "dbeurive (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dbeurive-slim-requester/health.svg)

```
[![Health](https://phpackages.com/badges/dbeurive-slim-requester/health.svg)](https://phpackages.com/packages/dbeurive-slim-requester)
```

###  Alternatives

[palanik/corsslim

Cross-origin resource sharing (CORS) middleware for PHP Slim.

94381.8k3](/packages/palanik-corsslim)[oat-sa/tao-core

TAO core extension

66140.1k108](/packages/oat-sa-tao-core)[mhndev/slim-file-response

Slim File Response

112.6k](/packages/mhndev-slim-file-response)

PHPackages © 2026

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