PHPackages                             prolix/restclientbundle - 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. prolix/restclientbundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

prolix/restclientbundle
=======================

Provides REST request methods. Mapper bundle for php internal curl library

2.0.7(2y ago)0943MITPHPPHP &gt;=8.2

Since Mar 21Pushed 2y agoCompare

[ Source](https://github.com/prolixtechnikos/CiRestClientBundle)[ Packagist](https://packagist.org/packages/prolix/restclientbundle)[ RSS](/packages/prolix-restclientbundle/feed)WikiDiscussions master Synced 1mo ago

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

RestClientBundle
================

[](#restclientbundle)

A Smart REST client with an intuitive API, providing all REST methods and returning a Symfony Response Object.

Motivation
==========

[](#motivation)

There are some Symfony2 bundles providing abstractions for REST requests, but none of them is actually feeling like: "That's what I was looking for!". Having used some of these in the past, we always had to improve or remap their API's for our own needs.

Some days ago we faced the same frustrating challenge again and started to meditate about the idea that our specific API needs really aren't that particular. So we questioned ourselves how a simple REST-Client-API should look like:

```
$restclient->post($url, $payload);
$restclient->get($url);
$restclient->put($url, $payload);
$restclient->delete($url);
```

Another concern was the leaky abstraction many of the other bundles present to us in respect to the output: They map the PHP-native curl-addon's API to an object-oriented interface only to let us work with the non-object-oriented original output of curl's API calls. At this point it is more convenient to stay with the (extremely inconvenient) PHP internal curl API only.

But how should outputs be wrapped?

- So by visiting this page you are probably a Symfony developer
- Thus we can infer that you know about the Symfony Response Object

So the Symfony Response Object is our choice to go: We don't need to roll out our own implementation and can stay within the boundaries of our framework of choice - win/win :-).

So all in all let's call it a day and start goin' gorillas with this one.

Installation
============

[](#installation)

Step 1: Download the bundle using composer
------------------------------------------

[](#step-1-download-the-bundle-using-composer)

Add the bundle by running the command:

```
php composer.phar require ci/restclientbundle
```

Composer will install the bundle to your project's `vendor/ci` directory.

Step 2: Enable the bundle
-------------------------

[](#step-2-enable-the-bundle)

Enable the bundle in the symfony kernel

```
