sparqapi/api/application/helpers/myhttpclient_helper.php
2019-06-22 11:42:25 +05:30

30 lines
400 B
PHP

<?php
class MYHTTPCLIENT
{
// Create the http client
public static function sendPost($dataToBot)
{
include_once APPPATH.'/vendor/autoload.php';
if(true)
{
$client = new \GuzzleHttp\Client();
$client->post( URL_TO_SEND_DATA, [
'headers' => ['Content-Type' => 'application/json'],
'body' => json_encode($dataToBot)
]);
//return $response;
}
}
}
?>