/**
  * @param string $method
  * @param string $uri
  * @param string|array $body
  */
 public function sendRequest($method, $uri, $body = null)
 {
     if (false === $this->hasHost($uri)) {
         $uri = rtrim($this->host, '/') . '/' . ltrim($uri, '/');
     }
     $this->request = $this->messageFactory->createRequest($method, $uri, $this->requestHeaders, $body);
     $this->response = $this->httpClient->sendRequest($this->request);
     if (null !== $this->responseStorage) {
         $this->responseStorage->writeRawContent((string) $this->response->getBody());
     }
 }
 /**
  * @param string $method
  * @param string $url
  * @param string|array $body
  */
 public function sendRequest($method, $url, $body = null)
 {
     try {
         $this->send($method, $url, $body);
     } catch (HttpAdapterException $e) {
         if ($e->hasResponse()) {
             $this->response = $e->getResponse();
         }
         if (null === $this->response) {
             throw $e;
         }
     }
     if (null !== $this->responseStorage) {
         $this->responseStorage->writeRawContent($this->response->getBody()->getContents());
     }
 }