PHPackages                             sainsburys/sainsburys-http-service - 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. sainsburys/sainsburys-http-service

ActiveLibrary

sainsburys/sainsburys-http-service
==================================

2.2.0(10y ago)91.6k4[3 issues](https://github.com/sainsburys/sainsburys-http-service/issues)MITPHPPHP &gt;=7.0.0

Since Nov 25Pushed 9y ago50 watchersCompare

[ Source](https://github.com/sainsburys/sainsburys-http-service)[ Packagist](https://packagist.org/packages/sainsburys/sainsburys-http-service)[ RSS](/packages/sainsburys-sainsburys-http-service/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (9)Dependencies (12)Versions (11)Used By (0)

[![Build Status](https://camo.githubusercontent.com/1592714c1e052bbdb00a39bfadeff2d5b1c41ac8dbf40296f5739a0b4399ccb6/68747470733a2f2f7472617669732d63692e6f72672f616e6f6269692f7361696e7362757279732d687474702d736572766963652e7376673f6272616e63683d747261766973)](https://travis-ci.org/anobii/sainsburys-http-service)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/36557dcba360e84aa9146f7af1bfeba16fade111cb569924c86db18b7b7c9ad0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e6f6269692f7361696e7362757279732d687474702d736572766963652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d617374657226733d61643666373531623066343065313234366533306163376231383562346133623335633566636333)](https://scrutinizer-ci.com/g/anobii/sainsburys-http-service/?branch=master)

[![logo](https://camo.githubusercontent.com/a81a0af363d428467f713dc7da3d808635bfae645d4aa27ee3f07e1fccd35a2b/687474703a2f2f7777772e7361696e7362757279732e636f2e756b2f686f6d65706167652f696d616765732f7361696e7362757279732e706e67)](https://camo.githubusercontent.com/a81a0af363d428467f713dc7da3d808635bfae645d4aa27ee3f07e1fccd35a2b/687474703a2f2f7777772e7361696e7362757279732e636f2e756b2f686f6d65706167652f696d616765732f7361696e7362757279732e706e67)

Sainsburys HTTP Service Framework
=================================

[](#sainsburys-http-service-framework)

PHP micro-framework for small REST or HTTP RPC services. Built and open sourced by J Sainsbury plc.

The framework is basically a wrapper for the Slim micro-framework in PHP, but works only with a more structured application.

It relies on Slim 3.

Version 1.x.x is an LTS version with support for PHP 5.5. Version 2.0.0 and subsequent require PHP 7.

Basic Usage
-----------

[](#basic-usage)

See the [sample application](https://github.com/anobii/sainsburys-http-service/tree/master/src-dev/sample-application)for an example of how to use it. The sample application is used by the automated tests as well, so will be up-to-date.

Core Concepts
-------------

[](#core-concepts)

**Standards Compliance**

The framework aims to comply with the [PSR-3](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md)standard for interchangable loggers, the [PSR-7](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-7-http-message.md)standard for interchangable HTTP request and response objects, the [Container-Interop](https://github.com/container-interop/container-interop)standard for interchangable Dependency Injection Containers, and with [semantic versioning](http://semver.org/) in its release numbers.

**Controllers and Dependency Injection**

This is what a controller should look like:

```
