sparqapi/api/application/helpers/myhttpclient_helper.php
2019-02-19 13:41:40 +05:30

28 lines
495 B
PHP

<?php
class MYHTTPCLIENT
{
// Create the http client
public static function sendPost($dataToBot)
{
include_once APPPATH.'/vendor/autoload.php';
if(LOGTOBOT == true)
{
$client = new \GuzzleHttp\Client();
$response = $client->post( 'https://cliq.zoho.com/api/v2/bots/sample/incoming?authtoken=467975ee8e33abf1549803925eaace0f', [
'headers' => ['Content-Type' => 'application/json'],
'body' => json_encode($dataToBot)
]);
//return $response;
}
}
}
?>