Create decoration, rely to given client
@param string $method
@param string $url
@param array $headers
@return AbstractRequest
171743
public function createRequest($method, $url = '', array $headers = [])
    {
        return $this->client->createRequest($method, $url, $headers);
    }
13135
public function createRequest($method, $uri, array $headers = [], array $options = [])
    {
        $body = JsonRpc\json_encode($this->addIdToRequest($method, $options));

        return new Request('POST', $uri, $headers, $body === false ? null : $body);
    }
909282
public function request($method = self::REQUEST_POST, $resource, array $params = [], array $headers = [])
    {
        $signature = $this->createSignature($resource);
        $method = strtoupper($method);

        $options = [
            'headers' => array_merge($headers, [
                'X-Auth-Key' => $this->key,
                'X-Auth-Workspace' => $this->workspace,
                'X-Auth-Signature' => $signature,
                'Content-Type' => 'application/json; charset=utf-8',
                'Accept' => 'application/json'
            ])
        ];

        /**
         * If POST and data is not an url then send data in body as json string
         */
        if ($method === self::REQUEST_POST && isset($params['data']) && !self::isUrl($params['data']))
        {
            if (is_string($params['data']))
            {
                $params['data'] = self::stringToArray($params['data']);
            }

            if ($params['data'])
            {
                $options[\GuzzleHttp\RequestOptions::JSON] = $params['data'];
                unset($params['data']);
            }
        }

        $options[\GuzzleHttp\RequestOptions::QUERY] = $params;
        return $this->handleRequest($method, $resource, $options);
    }
436697
protected function buildRequest(
        $method,
        $uri,
        array $headers,
        $body = null,
        $version = '1.1',
        $retries = 0,
        array $options = [],
        $serviceKey,
        $requestKey
    ) {
        return new Request($method, $uri, $headers, $body, (string)$version, $retries, $options, $serviceKey, $requestKey);
    }
776241
public function build($method, Url $url, array $headers)
    {
        if (($scheme = self::isAllowedScheme((string)$url->scheme())) === false) {
            throw new UnknownProtocolException(sprintf(
                "You can't request a transfer on unsupported protocol '%s'!",
                $url->scheme()
            ));
        }

        $scheme = ucfirst($scheme);
        $name = __NAMESPACE__.'\\'.$scheme.'\\'.ucfirst(strtolower($method));
        if (!class_exists($name)) {
            throw new InvalidArgumentException('Method given is not a valid request: '.$method);
        }

        $configurationClass = '\Bee4\Transport\Configuration\\'.$scheme.'Configuration';
        $request = new $name(
            $url,
            $headers,
            new $configurationClass(
                $this->configuration!==null?$this->configuration->toArray():[]
            )
        );

        return $request;
    }
804247
protected function sendRequest($method, $url, $data = [], $headers = [])
    {
        $this->addRequestSourceHeader($headers);
        $data['http_errors'] = false;
        $data['headers'] = $headers;
        $response = $this->http_client->request($method, $url, $data);

        return $response;
    }
133843
protected function query($method, $url, array $parameters = null)
    {
        return $this->httpClient->query($method, $url, $parameters);
    }
12976
private function _request($method, $url, array $options) {
		try {
			$response = $this->httpClient->{$method}($url, $options);
		} catch(ClientException $e) {
			$response = $e->getResponse();
		} catch(ConnectException $e) {
			$this->_throwServerError($e);
		} catch (RequestException $e) {
			$this->_throwServerError($e);
		}

		return $response;
	}
140084
public static function patch($url, $headers = [], $body = null)
    {
        return Request::create('default')->patch($url, $headers, $body);
    }
632572
public function invoke($uri, $method, array $headers = [])
    {
        $client   = new Client();
        $res      = $client->createRequest(strtoupper($method), url('/') . '/' . $uri, array_merge($headers, $this->getHeaders()));
        $response = $res->send();
        $types    = $response->getHeader('Content-Type')->toArray();
        $body     = $response->getBody(true);
        foreach ($types as $type) {
            if ($type == 'application/json' && function_exists('json_decode') and is_string($body)) {
                return json_decode($body);
            }
        }

        return $body;
    }
948894
public static function post($url, $headers = [], $body = null)
    {
        return Request::create('default')->post($url, $headers, $body);
    }
629956
public function api($apiUrl, $method = 'GET', array $params = [], array $headers = [])
    {
        $client = new HttpClient();
        $response = $client->createRequest()
            ->setMethod($method)
            ->addHeaders($headers)
            ->setUrl($apiUrl)
            ->setData($params)
            ->send();
        return $response->content;
    }
174642
public static function put($url, $headers = [], $body = null)
    {
        return Request::create('default')->put($url, $headers, $body);
    }
967160
public function createSymmetricEncryptedRequest(
        string $method,
        string $uri,
        string $body,
        SharedEncryptionKey $key,
        array $headers = []
    ): RequestInterface {
        return new Request(
            $method,
            $uri,
            $headers,
            Base64UrlSafe::encode(Simple::encrypt($body, $key))
        );
    }
675453
public static HttpResponse execute(final String url, final String method,
                                       final Map<String, Object> headers) {
        return execute(url, method, null, null, new HashMap<>(), headers);
    }
1268417
public function api($url, $method, array $params = [], array $headers = [])
    {
        try {
            return $this->sendRequest($method, $url, $params, $headers);
        } catch (\Exception $e) {
            sleep(2);
            return $this->sendRequest($method, $url, $params, $headers);
        }
    }
1362509
public function request($method, array $uriParts, array $options = [], array $headers = []) {

        $requestSigner = new RequestSigner($this->getAuth(), $method, $uriParts, $options);
        $headers += $requestSigner->getHeaders();

        return parent::request($method, $uriParts, $options, $headers);

    }