PHPackages                             harryosmar/php-restful-api-response - 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. [API Development](/categories/api)
4. /
5. harryosmar/php-restful-api-response

ActiveLibrary[API Development](/categories/api)

harryosmar/php-restful-api-response
===================================

php restful api response implement PSR-7: HTTP message interfaces

v1.1.4(7y ago)3655PHPPHP &gt;=7.0

Since Feb 14Pushed 7y ago2 watchersCompare

[ Source](https://github.com/harryosmar/php-restful-api-response)[ Packagist](https://packagist.org/packages/harryosmar/php-restful-api-response)[ RSS](/packages/harryosmar-php-restful-api-response/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (10)Dependencies (5)Versions (11)Used By (0)

php rest-api response implement PSR-7: HTTP message interfaces
==============================================================

[](#php-rest-api-response-implement-psr-7-http-message-interfaces)

[![Latest Version](https://camo.githubusercontent.com/9c2f67aa23c6b414df23c39c5d1110cd58cbeb42b967ca05c78e66b547738e6f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f68617272796f736d61722f7068702d7265737466756c2d6170692d726573706f6e73652e7376673f7374796c653d666c61742d737175617265)](https://github.com/harryosmar/php-restful-api-response/releases)[![Build Status](https://camo.githubusercontent.com/bb4732a523cb6f6da80a488cc08632dfaeb57f9926c99881a830ba94e13ef96d/68747470733a2f2f7472617669732d63692e6f72672f68617272796f736d61722f7068702d7265737466756c2d6170692d726573706f6e73652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/harryosmar/php-restful-api-response)[![Build Status](https://camo.githubusercontent.com/0cfd6605afb105105a6bc98bd59e9455086e4a05e85db9949f77b59a55d440f3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68617272796f736d61722f7068702d7265737466756c2d6170692d726573706f6e73652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/harryosmar/php-restful-api-response/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4c2551af26e862e3aaa66d8b7bca471409e93a3b56a2f9027041850cebc84ab0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68617272796f736d61722f7068702d7265737466756c2d6170692d726573706f6e73652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/harryosmar/php-restful-api-response/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/1567f0c09627c8b440f95477062072af224411b1fe209f616f0daa3d24f77f9f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68617272796f736d61722f7068702d7265737466756c2d6170692d726573706f6e73652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/harryosmar/php-restful-api-response/?branch=master)

Requirements
------------

[](#requirements)

- php &gt;= 7.0
- composer

Features
--------

[](#features)

- Implement PSR-7: HTTP message interfaces, extend
- Provides response format [collection](#with-collection) &amp; [item](#with-item) using library
- Provides basic [errors response](#error)

How To Setup
------------

[](#how-to-setup)

- *add this lines to your `composer.json` file*

```
{
    "require": {
        "harryosmar/php-restful-api-response": "^1.1"
    }
}

```

- *then run `composer install` or `composer update`*

How To Use
----------

[](#how-to-use)

Simple example how to use

```
