This package is abandoned and no longer maintained. The author suggests using the bee4/transport package instead.

A simple chainable transport client.

v2.0.0 2016-08-31 16:37 UTC


Build Status Scrutinizer Code Quality Code Coverage SensiolabInsight


This library is a transport client that can be used to handle HTTP, FTP, FTPS, SFTP, SCP calls. All protocols are processed the same way and the API is a simple Request > Response mechanism.

It is inspired by the Guzzle 3 implementation with a simpler approach (no curl_multi, no SSL...), just Request and Response handling. For the moment cURL is the only implementation and all Requests options are CURL_* options...


Latest Stable Version Total Downloads

This project can be installed using Composer. Add the following to your composer.json:

    "require": {
        "bee4/transport": "~1.2"

or run this command:

composer require bee4/transport:~1.2


You must create a Client instance then built the request and send it to retrieve the response.

$client = new Bee4\Transport\MagicHandler();
$request = $client->get('', ['Accept: text/html']);
$response = $request->send();

$respose->getStatusMessage(); //Retrieve the status definition example: 301 Moved Permanently
$respose->getBody(); //Retrieve response content

//The same is possible with FTP
$request = $client->head('')->send();
//Remove a file

//And SFTP - Upload a file
  ->setBody('File content here')

A mapping is done between HTTP methods name and client calls to maintain the same API :

  • head is used to check if the resource is here ;
  • get is used to retrieve a resource ;
  • put is used to upload a resource ;
  • delete is used to remove a resource.

Others method are handled only by HTTP: POST