sparqapi/api/application/helpers/myhttpclient_helper.php
2019-02-19 19:55:59 +05:30

28 lines
407 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( BOTURL, [
'headers' => ['Content-Type' => 'application/json'],
'body' => json_encode($dataToBot)
]);
//return $response;
}
}
}
?>