public function request($method, $uri, $params = array(), $data = array(), $headers = array(), $username = null, $password = null, $timeout = null) {
        $username = $username ? $username : $this->username;
        $password = $password ? $password : $this->password;

        $headers['User-Agent'] = 'twilio-php/' . VersionInfo::string() .
                                 ' (PHP ' . phpversion() . ')';
        $headers['Accept-Charset'] = 'utf-8';

        if ($method == 'POST' && !array_key_exists('Content-Type', $headers)) {
            $headers['Content-Type'] = 'application/x-www-form-urlencoded';
        }

        if (!array_key_exists('Accept', $headers)) {
            $headers['Accept'] = 'application/json';
        }

        if ($this->region) {
            list($head, $tail) = explode('.', $uri, 2);

            if (strpos($tail, $this->region) !== 0) {
                $uri = implode('.', array($head, $this->region, $tail));
            }
        }

        return $this->getHttpClient()->request(
            $method,
            $uri,
            $params,
            $data,
            $headers,
            $username,
            $password,
            $timeout
        );
    }
public function request($method, $uri, $params = array(), $data = array(), $headers = array(), $username = null, $password = null, $timeout = null) {
        $username = $username ? $username : $this->username;
        $password = $password ? $password : $this->password;

        $headers['User-Agent'] = 'twilio-php/' . VersionInfo::string() .
                                 ' (PHP ' . phpversion() . ')';
        $headers['Accept-Charset'] = 'utf-8';

        if ($method == 'POST' && !array_key_exists('Content-Type', $headers)) {
            $headers['Content-Type'] = 'application/x-www-form-urlencoded';
        }

        if (!array_key_exists('Accept', $headers)) {
            $headers['Accept'] = 'application/json';
        }

        if ($this->region) {
            list($head, $tail) = explode('.', $uri, 2);

            if (strpos($tail, $this->region) !== 0) {
                $uri = implode('.', array($head, $this->region, $tail));
            }
        }

        return $this->getHttpClient()->request(
            $method,
            $uri,
            $params,
            $data,
            $headers,
            $username,
            $password,
            $timeout
        );
    }
public function request ( $ method , $ uri , $ params = array ( ) , $ data = array ( ) , $ headers = array ( ) , $ username = null , $ password = null , $ timeout = null ) { $ username = $ username ? $ username : $ this -> username ; $ password = $ password ? $ password : $ this -> password ; $ headers [ 'User-Agent' ] = 'twilio-php/' . VersionInfo :: string ( ) . ' (PHP ' . phpversion ( ) . ')' ; $ headers [ 'Accept-Charset' ] = 'utf-8' ; if ( $ method == 'POST' && ! array_key_exists ( 'Content-Type' , $ headers ) ) { $ headers [ 'Content-Type' ] = 'application/x-www-form-urlencoded' ; } if ( ! array_key_exists ( 'Accept' , $ headers ) ) { $ headers [ 'Accept' ] = 'application/json' ; } if ( $ this -> region ) { list ( $ head , $ tail ) = explode ( '.' , $ uri , 2 ) ; if ( strpos ( $ tail , $ this -> region ) !== 0 ) { $ uri = implode ( '.' , array ( $ head , $ this -> region , $ tail ) ) ; } } return $ this -> getHttpClient ( ) -> request ( $ method , $ uri , $ params , $ data , $ headers , $ username , $ password , $ timeout ) ; }
Makes a request to the Twilio API using the configured http client
Authentication information is automatically added if none is provided

@param string $method HTTP Method
@param string $uri Fully qualified url
@param string[] $params Query string parameters
@param string[] $data POST body data
@param string[] $headers HTTP Headers
@param string $username User for Authentication
@param string $password Password for Authentication
@param int $timeout Timeout in seconds
@return \Twilio\Http\Response Response from the Twilio API
Makes a request to the Twilio API using the configured http client Authentication information is automatically added if none is provided