PHPackages                             robertmain/communique - 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. robertmain/communique

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

robertmain/communique
=====================

A flexible pluggable REST client

v0.0.3(10y ago)0193[5 issues](https://github.com/robertmain/communique/issues)[1 PRs](https://github.com/robertmain/communique/pulls)GPLPHP

Since Sep 8Pushed 8y ago4 watchersCompare

[ Source](https://github.com/robertmain/communique)[ Packagist](https://packagist.org/packages/robertmain/communique)[ RSS](/packages/robertmain-communique/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (7)Used By (0)

Communique
==========

[](#communique)

[![Join the chat at https://gitter.im/robertmain/communique](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/robertmain/communique?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[![Build Status](https://camo.githubusercontent.com/bf1e7aaa458e10241446fceab0227f8cd0bcc7e7a88d6d4564d0d99853e723e4/68747470733a2f2f7472617669732d63692e6f72672f726f626572746d61696e2f636f6d6d756e697175652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/robertmain/communique)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/19ac365b210d9f66f1cf4f8c8436104f4aa95380db0dda09c2d2f707742ea869/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726f626572746d61696e2f636f6d6d756e697175652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/robertmain/communique/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/50043e33db0d442d4fcbb6d692f0048f103d221dd3a99c35f957aaad878b20b8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f726f626572746d61696e2f636f6d6d756e697175652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/robertmain/communique/?branch=master)

[![Latest Stable Version](https://camo.githubusercontent.com/3fb54c1a50b53bda8661aef3f2845b60824b21ba5391f7cae177e28ff0fa6c3b/68747470733a2f2f706f7365722e707567782e6f72672f726f626572746d61696e2f636f6d6d756e697175652f762f737461626c65)](https://packagist.org/packages/robertmain/communique)[![Total Downloads](https://camo.githubusercontent.com/1165a53440b332ffeff4316a933497a6254c356c866c28a2d0c98af3fefb1462/68747470733a2f2f706f7365722e707567782e6f72672f726f626572746d61696e2f636f6d6d756e697175652f646f776e6c6f616473)](https://packagist.org/packages/robertmain/communique)[![Latest Unstable Version](https://camo.githubusercontent.com/6ebdbe7ca422add19c3c425f89a4421386bdd368c252b26bc07f3e5821829cae/68747470733a2f2f706f7365722e707567782e6f72672f726f626572746d61696e2f636f6d6d756e697175652f762f756e737461626c65)](https://packagist.org/packages/robertmain/communique)[![License](https://camo.githubusercontent.com/afecb4d311d35faa05d6469ec0e01c0ea72d4deac1c6cf0e550037a376c74667/68747470733a2f2f706f7365722e707567782e6f72672f726f626572746d61696e2f636f6d6d756e697175652f6c6963656e7365)](https://packagist.org/packages/robertmain/communique)[![Monthly Downloads](https://camo.githubusercontent.com/7ac0663e891e88551ff9841b60777b3e622ef8ab85682e71f30a1846b9dd946c/68747470733a2f2f706f7365722e707567782e6f72672f726f626572746d61696e2f636f6d6d756e697175652f642f6d6f6e74686c79)](https://packagist.org/packages/robertmain/communique)[![Daily Downloads](https://camo.githubusercontent.com/a80d436e98819fd1b4f4726236863853fe43625c3232467e368b31eab9ff61c1/68747470733a2f2f706f7365722e707567782e6f72672f726f626572746d61696e2f636f6d6d756e697175652f642f6461696c79)](https://packagist.org/packages/robertmain/communique)

What is it?
-----------

[](#what-is-it)

A flexible pluggable REST client using middleware. The aim of this project is to provide a REST client that is flexible enough to permit the modification of the request and response using request and response interceptors(conceptually similar to AngularJS, although implemented somewhat differently).

Usage
-----

[](#usage)

### Typical Usage

[](#typical-usage)

You can make a request with the REST library using the code below. It is worth noting, the get, put, post, delete etc. methods do not return the raw response payload, but an encapsulation object of type [\\Communique\\RESTClientResponse](http://robertmain.github.io/communique/classes/Communique.RESTClientResponse.html). This object contains

1. The HTTP status code (200, 201, 404, 500 etc.)
2. The response payload (the response body from the server)
3. The server headers (any headers that the server returned with the payload, these are often useful for cache control).

You can find more information from the [\\Communique\\RESTClientResponse](http://robertmain.github.io/communique/classes/Communique.RESTClientResponse.html) documentation

```
