protected function send($method, $endpointUri, $body = null, array $headers = [])
    {
        $headers = array_merge($headers, self::getDefaultHeaders());
        $endpointUrl = $this->baseUrl . $endpointUri;

        $request = new Request($method, $endpointUrl, $headers, json_encode($body));
        $response = $this->getHttpClient()->sendRequest($request);

        return $this->handleResponse($response);
    }
protected function send($method, $endpointUri, $body = null, array $headers = [])
    {
        $headers = array_merge($headers, self::getDefaultHeaders());
        $endpointUrl = $this->baseUrl . $endpointUri;

        $request = new Request($method, $endpointUrl, $headers, json_encode($body));
        $response = $this->getHttpClient()->sendRequest($request);

        return $this->handleResponse($response);
    }
protected function send ( $ method , $ endpointUri , $ body = null , array $ headers = [ ] ) { $ headers = array_merge ( $ headers , self :: getDefaultHeaders ( ) ) ; $ endpointUrl = $ this -> baseUrl . $ endpointUri ; $ request = new Request ( $ method , $ endpointUrl , $ headers , json_encode ( $ body ) ) ; $ response = $ this -> getHttpClient ( ) -> sendRequest ( $ request ) ; return $ this -> handleResponse ( $ response ) ; }
Execute HTTP request

@param  string $method
@param  string $endpointUri
@param  string $body
@param  array $headers
@return [type]
Execute HTTP request