public function sendRawMessage($message) { $this->curlWrapper->addHeader('Content-Type', 'application/json'); $url = $this->baseUrl . 'post'; $payload = array('bot_id' => $this->botId, 'text' => $message); try { $response = $this->curlWrapper->rawPost($url, json_encode($payload)); } catch (\Exception $e) { die($e->getMessage()); } return $response; }
public function getInfoFromFD($fd_url, $access_token) { $curlWrapper = new CurlWrapper(); $curlWrapper->addHeader("Authorization", "Bearer {$access_token}"); $result = $curlWrapper->get($fd_url); return json_decode($result, true); }