A Curl Wrapper for RESTful APIs
To Install use composer:
composer require mega6382/rest-api-wrapper
$url = "https://example.com/";
$raw = new raw\restApiWrapper($url);
$request = $raw->post(
'ufkbi1uf', // Endpoint to the API
[ //POST Params
'param1' => 'abc',
'param2' => 'def',
'param3' => 'ghi',
],
[ //Request Headers
'Content-Type: application/xml',
'Connection: Keep-Alive'
],
'json' //Return type
);
var_dump($request);
$request = $raw->get('ufkbi1uf', [], [], '');
var_dump($request);
$request = $raw->options('ufkbi1uf', ['name' => 'basil'], [], '');
var_dump($request);