public function request($path, $method, $rawData = null, $params = [])
    {
        $method  = strtoupper($method);
        $path    = ltrim($path, '/');
        $path    = $path . '.' . $this->format;
        $client  = $this->getHttpClient();
        $method  = strtoupper($method);
        $options = [
            'query' => $params,
            'body' => null,
        ];

        $request = new Request($method, $path);

        if (in_array($method, array('POST', 'PUT'))) {
            if (null === $rawData) {
                throw new BadMethodCallException('You must send raw data in a POST or PUT request');
            }
        }

        if (!empty($rawData)) {
            $options['body'] = Psr7\stream_for($rawData);
        }

        try {
            $response = $client->send($request, $options);
        } catch (RequestException $e) {
            if ($e->hasResponse()) {
                $response = $e->getResponse();
            } else {
                $response = false;
            }
        }

        $this->lastResponse = $response;

        return $response;
    }