src/Http/RequestManager.php
public function send($method, $url, $body = null, $headers = array())
    {
        $request = $this->getMessageFactory()->createRequest($method, $url, $headers, $body);

        try {
            $response = $this->getClient()->sendRequest($request);
        } catch (TransferException $e) {
            $message = 'Error sending request. ';
            if ($e instanceof \Http\Client\Exception\HttpException) {
                $message .= (string) $e->getResponse()->getBody();
            }

            throw new HttpException($message, $e->getCode(), $e);
        }

        // TODO add more error checks
        return json_decode($response->getBody()->__toString(), true);
    }
public function send($method, $url, $body = null, $headers = array())
    {
        $request = $this->getMessageFactory()->createRequest($method, $url, $headers, $body);

        try {
            $response = $this->getClient()->sendRequest($request);
        } catch (TransferException $e) {
            $message = 'Error sending request. ';
            if ($e instanceof \Http\Client\Exception\HttpException) {
                $message .= (string) $e->getResponse()->getBody();
            }

            throw new HttpException($message, $e->getCode(), $e);
        }

        // TODO add more error checks
        return json_decode($response->getBody()->__toString(), true);
    }
@param string $method
@param string $url
@param array  $data

@return array

@throws HttpException