@param $uri
@param array $headers

@return mixed|void
3654
public function get($uri,array $headers)
        {
            return $this->prepareRequest(self::GET,$uri,$headers,null);
        }
1300248
function setHeaders($headers){
		$this->debug("setHeaders headers=");
		$this->appendDebug($this->varDump($headers));
		$this->requestHeaders = $headers;
	}
24787
public function delete($uri, $parameters=array(), $headers=array(), $rawencoding=null)
    {
        return $this->request($uri, 'DELETE', $parameters, $headers, $rawencoding);
    }
939829
public function execute($url, $postString = '', array $headers = [])
    {
        return $this
            ->init($url, $postString, $headers)
            ->callCurl();
    }
930244
public function post($uri,array $headers,$body)
        {
            return $this->prepareRequest(self::POST,$uri,$headers,$body);
        }
277670
public function options($uri,array $headers,$body)
        {
            return $this->prepareRequest(self::OPTIONS,$uri,$headers,$body);
        }
650633
public function head($url, $headers = [], $parameters = null)
    {
        return $this->send(Method::HEAD, $url, $parameters, $headers);
    }
942656
private function execute($url, array $headers = array(), $callable = null)
    {
        $curl = curl_init();

        curl_setopt($curl, CURLOPT_URL, $this->fixUrl($url));
        curl_setopt($curl, CURLOPT_HEADER, true);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

        if ($this->getMaxRedirects() > 0) {
            curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
            curl_setopt($curl, CURLOPT_MAXREDIRS, $this->getMaxRedirects());
        }

        if (!empty($headers)) {
            curl_setopt($curl, CURLOPT_HTTPHEADER, $this->fixHeaders($headers));
        }

        if ($callable !== null) {
            call_user_func($callable, $curl);
        }

        if (($response = curl_exec($curl)) === false) {
            $error = curl_error($curl);
            curl_close($curl);

            throw HttpAdapterException::cannotFetchUrl($url, $this->getName(), $error);
        }

        $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        $headersSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
        $effectiveUrl = curl_getinfo($curl, CURLINFO_EFFECTIVE_URL);

        curl_close($curl);

        $headers = substr($response, 0, $headersSize);
        $body = substr($response, $headersSize);

        return $this->createResponse($statusCode, $url, $headers, $body, $effectiveUrl);
    }
174642
public static function put($url, $headers = [], $body = null)
    {
        return Request::create('default')->put($url, $headers, $body);
    }
345664
public function delete($url, $headers = [], $body = null)
    {
        return $this->send(Method::DELETE, $url, $body, $headers);
    }
870506
public function setHeaders(array $headers)
    {
        $cookies = $this->cookies;

        try {
            parent::setHeaders($headers);
        } catch (\Throwable $e) {
            $this->cookies = $cookies;

            throw $e;
        }
    }
1209351
public static function prepareUri(array $server, array $headers)
    {
        $uri = new PsrUri('');

        // URI scheme
        $scheme = 'http';
        $https = ServerHelper::getValue($server, 'HTTPS');

        // Is https or not
        if (($https && $https !== 'off') || HeaderHelper::getValue($headers, 'x-forwarded-proto', false) === 'https') {
            $scheme = 'https';
        }

        // URI host
        $host = '';
        $port = null;

        static::getHostAndPortFromHeaders($host, $port, $server, $headers);

        // URI path
        $path = static::getRequestUri($server);
        $path = static::stripQueryString($path);

        // URI query
        $query = '';

        if (isset($server['QUERY_STRING'])) {
            $query = ltrim($server['QUERY_STRING'], '?');
        }

        // URI fragment
        $fragment = '';

        if (strpos($path, '#') !== false) {
            list($path, $fragment) = explode('#', $path, 2);
        }

        return $uri->withScheme($scheme)
            ->withHost($host)
            ->withPort($port)
            ->withPath($path)
            ->withFragment($fragment)
            ->withQuery($query);
    }
528864
protected function delete($url, array $headers)
    {
        $request = [
            'headers' => array_merge(
                ['Content-Type' => 'application/json'],
                $headers
            ),
            'exceptions' => false,
        ];

        $this->request('delete', $url, $request);
    }
1098443
public function addHeaders($headers)
    {
        foreach ($headers as $name => $value) {
            $this->setHeader($name, $value);
        }
    }
466878
private function prepareRequest($method,$uri,array $headers,$body)
        {
            try {
                return $this->sendRequest(new Psr7\Request($method,$uri,$headers,$body));
            } catch (\Exception $e)
            {
                return json_encode(['responseCode' => $e->getCode(),'responseBody' => $e->getMessage()]);
            }
        }
1121484
protected function addHeaders(array $headers)
    {
        foreach ($headers as $key => $val) {
            $normalized = strtolower($key);
            $this->headers[$key] = (array)$val;
            $this->headerNames[$normalized] = $key;
        }
    }
1205284
public function patch($uri,array $headers,$body)
        {
            return $this->prepareRequest(self::PATCH,$uri,$headers,$body);
        }