If we are doing a GET request, turn it into URL params.

@param $headers
@return string
182274
private function processGetParams($headers)
    {
        $paramStrings = [];
        foreach ($headers['body'] as $key => $value) {
            $paramStrings[] = $key . "=" . $value;
        }
        $paramString = "?";
        $paramString .= implode("&", $paramStrings);

        return $paramString;
    }
721428
public function get($url,  array $headers = [], array $params = [])
    {
        return $this->instance->createHttpClient()->get($url, $headers, $params);
    }
175856
public static function formatHeadersForCurl(array $headers)
    {
        $curlHeaders = array();

        foreach ($headers as $key => $value) {
            $curlHeaders[] = $key . ': ' . $value;
        }

        return $curlHeaders;
    }
1320725
public static function parse_headers(string $headers): array
    {
        $final_headers = array();
        $list = explode("\n", trim($headers));

        $http = array_shift($list);

        foreach ($list as $header) {
            $parts = explode(':', $header, 2);
            $final_headers[trim($parts[0])] = isset($parts[1]) ? trim($parts[1]) : '';
        }

        return $final_headers;
    }
1108532
protected function makeUrl( array$params ):string
	{
		$url= $this->url;

		foreach( $params['path']??[] as $key=>$value )
		{
			$url= str_replace( "{{$key}}", $value, $url );
		}

		if( $params['query']??null )
		{
			$url.= '?'.http_build_query( $params['query'] );
		}

		return $url;
	}
451356
public function parseHeaders(array $headers)
    {
        $parsed = [];

        foreach ($headers as $key => $val)
        {
            $parsed[] = $key . ': ' . $val;
        }

        return $parsed;
    }
916263
public function _getCallUrl( &$requestHeaders = [] ): string
	{
		//  TODO: move logic to Guzzle?
		$requestHeaders = [];
		//  Platform against which will call be made
		$url_platformPart = $this->platforms->getPlatformName($this->getSetting(self::SET_REGION));

		//  API base url
		$url_basePart = $this->getSetting(self::SET_API_BASEURL);

		//  Query parameters
		$url_queryPart = "";
		foreach ($this->query_data as $key => $value)
		{
			if (is_array($value))
			{
				foreach ($value as $v)
					$url_queryPart.= "&$key=$v";
			}
			else
				$url_queryPart.= "&$key=$value";
		}
		$url_queryPart = substr($url_queryPart, 1);

		//  API key
		$url_keyPart = "";
		if ($this->getSetting(self::SET_KEY_INCLUDE_TYPE) === self::KEY_AS_QUERY_PARAM)
		{
			//  API key is to be included as query parameter
			$url_keyPart = "?api_key=" . $this->getSetting($this->used_key);
			if (!empty($url_queryPart))
				$url_keyPart.= '&';
		}
		elseif ($this->getSetting(self::SET_KEY_INCLUDE_TYPE) === self::KEY_AS_HEADER)
		{
			//  API key is to be included as request header
			$requestHeaders[self::HEADER_API_KEY] = $this->getSetting($this->used_key);
			if (!empty($url_queryPart))
				$url_keyPart = '?';
		}

		return "https://" . $url_platformPart . $url_basePart . $this->endpoint . $url_keyPart . $url_queryPart;
	}
900656
public static function get( $url, $params=null, $headers=null, $return_header = false )
	{
		$self = new self();
		if ( is_array($params) ) {
			$params = http_build_query($params);
			if ( strpos($url, '?') == false ) {
				$url .= '?'.$params;
			} else {
				$url .= '&'.$params;
			}
		}

		$curl = $self->_curlInit($url, $headers);
		curl_setopt($curl, CURLOPT_HTTPGET, true);
		return $self->_doRequest($curl, $return_header);
	}
765792
private function convertHeaders(array $headers)
    {
        $result = [];
        foreach ($headers as $key => $value) {
            $result[] = $key . ': ' . $value;
        }

        return $result;
    }
612501
private function normalizeHeaders($headers)
    {
        if (is_array($headers)) {
            $headers = new Headers($headers);
        } elseif (!($headers instanceof Headers)) {
            throw new InvalidArgumentException(
                'Headers must be an array or instance of Headers'
            );
        }

        return $headers;
    }
869567
public static function parseHeaders($headers)
    {
        $httpCode  = null;
        $result    = null;
        $processed = [];

        foreach (explode(HttpHelper::EOL, $headers) as $lineNumber => $line) {
            if ($lineNumber === 0) {
                // first line of result is special
                if (preg_match("/^HTTP\/\d+\.\d+\s+(\d+)/", $line, $matches)) {
                    $httpCode = (int) $matches[1];
                }
                $result = $line;
            } else {
                // other lines contain key:value-like headers
                // the following is a performance optimization to get rid of
                // the two trims (which are expensive as they are executed over and over) 
                if (strpos($line, ': ') !== false) {
                    list($key, $value) = explode(': ', $line, 2);
                } else {
                    list($key, $value) = explode(':', $line, 2);
                }
                $processed[strtolower($key)] = $value;
            }
        }

        return [$httpCode, $result, $processed];
    }
1200547
public function get($url, array $query = [], array $headers = [])
    {
        return $this->execute('GET', $this->buildGetUrl($url, $query), [], $headers);
    }
258920
protected function transformHeadersToServerVars(array $headers)
    {
        $server = [];
        $prefix = 'HTTP_';

        foreach ($headers as $name => $value) {
            $name = strtr(strtoupper($name), '-', '_');

            if (! Str::startsWith($name, $prefix) && $name != 'CONTENT_TYPE') {
                $name = $prefix.$name;
            }

            $server[$name] = $value;
        }

        return $server;
    }
1152653
private function parseHttpHeaders($headers) {
    $result = [];
    foreach ($headers as $header) {
      $values = explode(':', $header, 2);
      if (count($values) === 2) {
        list($key, $value) = $values;
        $key = trim($key);
        $value = trim($value);
        // Checking with real cURL it only sends a header if the key & the value
        // are set.
        if ($key && $value) {
          $result[$key] = $value;
        }
      }
    }
    return $result;
  }
126406
public static function get($url, $httpHeaders = array())
    {
        //Initialize the Curl resource
        $ch = self::init($url, $httpHeaders);

        return self::processRequest($ch);
    }
290236
public function get(string $url, array $headers = [])
    {
        $ctx = $this->getContext('GET', null, $headers);
        $response = file_get_contents($url, false, $ctx);
        $this->saveCookies($http_response_header);

        return $response;
    }
1120115
protected function getUrl($url, $headers, $timeout): ResponseInterface
    {
        try {
            $options = $this->buildGuzzleOptions($headers, $timeout);
            $response = $this->requestFactory->request($url, 'GET', $options);
        } catch (ClientException $e) {
            $response = $e->getResponse();
        } catch (ServerException $e) {
            $response = $e->getResponse();
        }

        return $response;
    }