daa/restful-curl-php-wrapper

Composer based cURL restful wrapper

v1.0 2014-12-21 22:23 UTC

This package is not auto-updated.

Last update: 2024-11-19 02:18:54 UTC


README

A simple composer based cURL wrapper providing RESTful HTTP requests

Usage

Add the following requirement to your composer file and do a composer install/update:

  "require": {
        ...
        "daa/restful-curl-php-wrapper": "1.*"
  },

Instantiate a new client in your code:

use Curl\Sdk\HttpClient;

$client = new HttpClient;

Make your call:

try {
    $response = $client->get($url);
    $response = $client->post($url, $params);
    $response = $client->put($url, $params);
    $response = $client->delete($url);
} catch(\Exception $e) {

}