i'm newbie in PHP. I use restclient (https://github.com/tcdent/php-restclient) to request as below:
<?php
require 'restclient.php';
$api = new RestClient();
$result = $api->get("https://api.github.com/repos/phatls/CallCenter_Customer/issues?state=all");
if($result->info->http_code == 200)
echo ($result->response);
else
echo "false";
?>
It works greatly. But with:
<?php
require 'restclient.php';
$api = new RestClient();
$result = $api->get("http://beka.vn/api/BkMobileLogin/GetGroup/phat.ls");
if($result->info->http_code == 200)
echo ($result->response);
else
echo "false";
?>
It returns false. Please help me if you don't have any inconvenient. thanks
please read official page documentation.link
Or follow this official example
$api = new RestClient([
'base_url' => "http://vimeo.com/api/v2",
'format' => "php"
]);
$result = $api->get("tcdent/info");
if($result->info->http_code == 200)
echo ($result->response);
else
echo "false";