Telegram\Bot\Api::post PHP Method

post() protected method

Sends a POST request to Telegram Bot API and returns the result.
protected post ( string $endpoint, array $params = [], boolean $fileUpload = false ) : TelegramResponse
$endpoint string
$params array
$fileUpload boolean Set true if a file is being uploaded.
return TelegramResponse
    protected function post($endpoint, array $params = [], $fileUpload = false)
    {
        if ($fileUpload) {
            $params = ['multipart' => $params];
        } else {
            if (array_key_exists('reply_markup', $params)) {
                $params['reply_markup'] = (string) $params['reply_markup'];
            }
            $params = ['form_params' => $params];
        }
        return $this->sendRequest('POST', $endpoint, $params);
    }