@param string $path
@param array  $parameters
@param array  $headers

@return Response|mixed|\Psr\Http\Message\ResponseInterface
@throws \GuzzleHttp\Exception\GuzzleException
355937
public function get($path, array $parameters = [], array $headers = [])
	{
		$this->setHeaders($headers);
		$this->setQuery($parameters);
		return $this->client->request('GET', $path, $this->headers);
	}
1062744
protected function httpPost(string $path, array $params = [], array $requestHeaders = []): ResponseInterface
    {
        $requestHeaders['Content-Type'] = 'application/x-www-form-urlencoded';

        return $this->httpPostRaw($path, http_build_query($params), $requestHeaders);
    }
1213372
protected function parseMetadata($path, array $headers)
    {
        $metadata = [
            'path' => $path,
            'visibility' => $this->visibility,
            'mimetype' => $this->parseMimeType($path, $headers),
        ];

        if (false !== $timestamp = $this->parseTimestamp($headers)) {
            $metadata['timestamp'] = $timestamp;
        }

        if (isset($headers['content-length']) && is_numeric($headers['content-length'])) {
            $metadata['size'] = (int) $headers['content-length'];
        }

        return $metadata;
    }
1313895
public function get($path, array $options = array())
    {
        $client = $this->createGuzzleClient($this->consumerKey, $this->consumerSecret);

        $options['auth'] = 'oauth';

        try {
            return json_decode($client->get('/1.1'.$path, $options)->getBody(), true);
        } catch (GuzzleRequestException $e) {
            $message = $e->getMessage();

            if ($e->hasResponse()) {
                $responseData = json_decode($e->getResponse()->getBody(), true);

                $messageParts = array();

                foreach ($responseData['errors'] as $error) {
                    $messageParts[] = $error['message'];
                }

                $message = implode($messageParts, "\n");
            }

            throw new RequestException($message);
        }
    }
1366410
protected function httpPostRaw(string $path, $body, array $requestHeaders = []): ResponseInterface
    {
        try {
            $response = $this->httpClient->sendRequest(
                $this->requestBuilder->create('POST', $path, $requestHeaders, $body)
            );
        } catch (Psr18\NetworkExceptionInterface $e) {
            throw HttpServerException::networkError($e);
        }

        return $response;
    }
581178
public function put($path, $body = null, array $parameters = [], $headers = [])
    {
        $response = $this->getClient()->getHttpClient()->put($path, $body, $parameters, $headers);

        return $this->decodeResponse($response);
    }
17396
protected function replaceRouteParameters($path, array &$parameters)
    {
        $this->ensureTenancyInParameters($path, $parameters);

        $path = $this->replaceNamedParameters($path, $parameters);

        $path = preg_replace_callback('/\{.*?\}/', function ($match) use (&$parameters) {
            return (empty($parameters) && ! Str::endsWith($match[0], '?}'))
                ? $match[0]
                : array_shift($parameters);
        }, $path);

        return trim(preg_replace('/\{.*?\?\}/', '', $path), '/');
    }
522091
public function request(string $path, array $params = null, string $method = null, $body = null, array $headers = null):ResponseInterface{
		$method = $method ?? 'GET';
		$params = $this->requestParams($path, $params ?? [], $body ?? []);

		if($method === 'POST'){
			$body   = $params;
			$params = [];
		}

#		return parent::request('', $params, $method, $body, $headers);

		$request = $this->requestFactory
			->createRequest($method, Psr7\merge_query($this->apiURL, $params));

		foreach(array_merge($this->apiHeaders, $headers ?? []) as $header => $value){
			$request = $request->withAddedHeader($header, $value);
		}

		if($method === 'POST'){
			$request = $request->withHeader('Content-Type', 'application/x-www-form-urlencoded');
			$body    = $this->streamFactory->createStream(http_build_query($body, '', '&', PHP_QUERY_RFC1738));
			$request = $request->withBody($body);
		}

		return $this->http->sendRequest($request);
	}
47064
public function send(
        string $route,
        array $path = [],
        array $query = [],
        array $headers = []
    ) {
        $request = $this->requestStack->getCurrentRequest();
        $headers = array_merge(null === $request ? [] : $request->headers->all(), $headers);

        $response = $this->producer->send(
            $this->requestService->create($route, $path, $query, $headers, $this->method)
        );

        $this->method = 'GET';

        return $response;
    }
337204
private function createRequest($path, $method, $parameters = [], $headers = [], $body)
    {
        $request =  new Request();

        $request
            ->setPath($path)
            ->setMethod($method)
            ->setParameters(new ParameterBag((array) $parameters))
            ->setHeaders(new ParameterBag((array) $headers))
            ->setBody($body)
            ->setOptions(new ParameterBag((array) $this->options))
        ;

        return $this->lastRequest = $request;
    }
10161
protected function put(string $path, array $params = [], array $headers = [])
    {
        $body = self::createJsonBody($params);

        if ($body) {
            $headers = self::addJsonContentType($headers);
        }

        return $this->putRaw($path, $body, $headers);
    }
827664
public function create($uri, $path = [], $parameters = [], $headers = [], $method = 'GET')
    {
        return $this->serializer->serialize(
            new Request($uri, $method, $path, $parameters, $headers),
            'json'
        );
    }
1222779
protected function put($path, array $parameters = array(), $requestHeaders = array())
    {
        foreach ($parameters as $name => $parameter) {
            if (is_bool($parameter)) {
                $parameters[$name] = $parameter ? 'true' : 'false';
            }
        }

        $response = $this->client->getHttpClient()->put(
            $path,
            $this->createParametersBody($parameters),
            $requestHeaders
        );

        return ResponseMediator::getContent($response);
    }
571292
public function secure($path, $status = 302, $headers = [])
    {
        return $this->to($path, $status, $headers, true);
    }
462386
protected function head($path, array $parameters = [], array $requestHeaders = [])
    {
        if (array_key_exists('ref', $parameters) && null === $parameters['ref']) {
            unset($parameters['ref']);
        }

        $response = $this->client->getHttpClient()->head($path.'?'.http_build_query($parameters), $requestHeaders);

        return $response;
    }
876147
private function get($path, $params = null, $headers = null)
    {
        return $this->run($path, array('method' => 'get', 'params' => $params, 'headers' => $headers));
    }
414441
protected function createRedirect($path, $status, $headers)
    {
        $redirect = new RedirectResponse($path, $status, $headers);

        $redirect->setRequest($this->app->make('request'));

        return $redirect;
    }