PHPackages                             jeroen/post-request-sender - 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. jeroen/post-request-sender

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

jeroen/post-request-sender
==========================

Micro library with interface for sending post requests. Includes test doubles and adapters

2.0.0(4y ago)032.8k↓12.5%GPL-2.0-or-laterPHPPHP ^8.1

Since Jan 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/JeroenDeDauw/PostRequestSender)[ Packagist](https://packagist.org/packages/jeroen/post-request-sender)[ Docs](https://github.com/JeroenDeDauw/PostRequestSender)[ GitHub Sponsors](https://github.com/JeroenDeDauw)[ RSS](/packages/jeroen-post-request-sender/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

Post Request Sender
===================

[](#post-request-sender)

[![Build Status](https://camo.githubusercontent.com/e79e69f12473eccb45fffa16431d83ba6cbada619e00a9fdac8639fac70e3e86/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4a65726f656e4465446175772f506f73745265717565737453656e6465722f63692e796d6c3f6272616e63683d6d6173746572)](https://github.com/JeroenDeDauw/PostRequestSender/actions?query=workflow%3ACI)[![codecov](https://camo.githubusercontent.com/13b5dd0f9af5fd243fc97cf50e43ccb2c44758056e485cb9fe71a63a54a86702/68747470733a2f2f636f6465636f762e696f2f67682f4a65726f656e4465446175772f506f73745265717565737453656e6465722f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d476e4f4733464631365a)](https://codecov.io/gh/JeroenDeDauw/PostRequestSender)[![Type Coverage](https://camo.githubusercontent.com/ce6023956b7f12298b2afd20c75c5bf409c1e4165d30ef89fb9783a60d3acb81/68747470733a2f2f73686570686572642e6465762f6769746875622f4a65726f656e4465446175772f506f73745265717565737453656e6465722f636f7665726167652e737667)](https://shepherd.dev/github/JeroenDeDauw/PostRequestSender)[![Psalm level](https://camo.githubusercontent.com/544c516d022e97707ea20b04162ff43829326f2f1bd53ac4bffbf083a244b6f4/68747470733a2f2f73686570686572642e6465762f6769746875622f4a65726f656e4465446175772f506f73745265717565737453656e6465722f6c6576656c2e737667)](psalm.xml)[![Latest Stable Version](https://camo.githubusercontent.com/33e619fc3be312aa41a5ccc9f5b64a2818e5ffb3201d169bbb7215df084c5b23/68747470733a2f2f706f7365722e707567782e6f72672f6a65726f656e2f706f73742d726571756573742d73656e6465722f76657273696f6e2e706e67)](https://packagist.org/packages/jeroen/post-request-sender)[![Download count](https://camo.githubusercontent.com/0066c294ee4bb90b4928c55c68a18b1d049477102c28f0effde0a1a23185742c/68747470733a2f2f706f7365722e707567782e6f72672f6a65726f656e2f706f73742d726571756573742d73656e6465722f642f746f74616c2e706e67)](https://packagist.org/packages/jeroen/post-request-sender)

Micro library with `PostRequestSender` interface and some [test doubles](https://en.wikipedia.org/wiki/Test_double).

For the common cases where you do not need the complexity of the heavyweight libraries.

```
interface PostRequestSender {

	/**
	 * @param string $url
	 * @param array $fields
	 */
	public function post( string $url, array $fields ): PostResponse;

}
```

Usage
-----

[](#usage)

```
$response = $requestSender->post( 'https://example.com', [ 'foo' => 'bar', 'baz' => 42 ] );
echo $response->body;
echo $response->statusCode;
```

Included implementations
------------------------

[](#included-implementations)

Adapters

- `GuzzlePostRequestSender` Adapter for Guzzle

Decorators

- `LoggingPostRequestSender` Takes a `Psr\Log\LoggerInterface`
- `SpyPostRequestSender` Test double that records calls

Test doubles

- `SpyPostRequestSender` Test double that records calls
- `StubPostRequestSender` Test double that returns a response provided in the constructor

Release notes
-------------

[](#release-notes)

### 2.0.0 (2022-02-03)

[](#200-2022-02-03)

- Ditched `ResponseInterface` in favor of a new simple value object `PostResponse`

### 1.0.1 (2022-02-02)

[](#101-2022-02-02)

- Fixed behavior of `TestResponse::getBody`

### 1.0.0 (2022-01-30)

[](#100-2022-01-30)

Initial release with

- `PostRequestSender` interface
- `SpyPostRequestSender` test double (and `PostRequest` value object)
- `StubPostRequestSender` test double
- `GuzzlePostRequestSender` implementation
- `LoggingPostRequestSender` decorator
- `TestResponse` helper implementation or PSR7 `ResponseInterface`

###  Health Score

32

—

LowBetter than 70% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

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

Total

3

Last Release

1587d ago

Major Versions

1.0.1 → 2.0.02022-02-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/451bd4039d530fed8f9c3da91bfa519233a397d2182cdfdcad700f6cfea19b7f?d=identicon)[Jeroen De Dauw](/maintainers/Jeroen%20De%20Dauw)

---

Top Contributors

[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (21 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jeroen-post-request-sender/health.svg)

```
[![Health](https://phpackages.com/badges/jeroen-post-request-sender/health.svg)](https://phpackages.com/packages/jeroen-post-request-sender)
```

###  Alternatives

[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k853.6M8.2k](/packages/symfony-http-kernel)[symfony/http-client

Provides powerful methods to fetch HTTP resources synchronously or asynchronously

2.1k330.1M4.5k](/packages/symfony-http-client)[zircote/swagger-php

Generate interactive documentation for your RESTful API using PHP attributes (preferred) or PHPDoc annotations

5.4k140.4M553](/packages/zircote-swagger-php)[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.3k66.1M251](/packages/nelmio-api-doc-bundle)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[api-platform/metadata

API Resource-oriented metadata attributes and factories

244.5M180](/packages/api-platform-metadata)

PHPackages © 2026

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