1. Go to this page and download the library: Download thinknet/request library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use ThinknetService;
class ServiceController extends Controller
{
protected $service;
public function __construct(Service $service)
{
$this->service = $service;
}
}
// get : Return this
public function getService()
{
$this->service->get(url, param);
}
// post : Return this
public function postService()
{
$this->service->post(url, param);
}
// put : Return this
public function putService()
{
$this->service->put(url, param);
}
// delete : Return this
public function deleteService()
{
$this->service->delete(url, param);
}