clarence/restful

A RESTful client, especially for async requests.

v1.0.8 2018-03-01 06:06 UTC

This package is not auto-updated.

Last update: 2024-05-07 08:47:23 UTC


README

Build status

A RESTful client, especially for async requests.

Install

From Composer

composer require clarence/restful

From github

git clone git@github.com:Clarence-pan/restful.git

Usage

Talk is cheap. Show the code:

use Clarence\Restful\Curl\CurlRestClient;

// Do a GET request
$data = ['test' => 'test', 'hello' => 'world!'];

$jsonResponse = $restClient->get('http://localhost:8888/server/echo-globals.php', $data)->json();
// then use the $jsonRespose....