src/Api.php
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
        );
    }
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
        );
    }
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 ) ; }
Sends a POST request to Telegram Bot API and returns the result.

@param string $endpoint
@param array  $params
@param bool   $fileUpload Set true if a file is being uploaded.

@return TelegramResponse
Sends a POST request to Telegram Bot API and returns the result .