PHPackages                             someniatko/simple-http-client - 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. someniatko/simple-http-client

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

someniatko/simple-http-client
=============================

Simple facade for PSR-7, PSR-17 and PSR-18

v0.1.0(6y ago)016MITPHPPHP ^7.1

Since Sep 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/someniatko/simple-http-client)[ Packagist](https://packagist.org/packages/someniatko/simple-http-client)[ RSS](/packages/someniatko-simple-http-client/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

simple-http-client
==================

[](#simple-http-client)

Writing implementation-agnostic code is a good practice, especially for pluggable libraries - they should not require using some concrete HTTP client for example. That's why PSR-18 - a standard HTTP client interface was born.

However, directly using PSR-18 HTTP Client interface (and, subsequently, PSR-7 requests and PSR-17 request factories) in your projects may be tedious, especially if you don't need that much of flexibility it provides.

This small library solves the dilemma: it contains one class, SimpleHttpClient, which does not implement PSR-18 on its own. However, it takes any PSR-18 client and PSR-17 factory, and returns PSR-7 response. This way you don't need to mess up with creating PSR-7 request manually, however you still have all the freedom of choosing any of the PSR-18 HTTP clients.

Usage
-----

[](#usage)

```
composer require someniatko/simple-http-client

```

```
