30 lines
400 B
PHP
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;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
?>
|