protected function connect($url, $headers = null)
    {
        if (!empty($headers)) {
            $client = new Client(['headers' => $headers]);
        }
        else {
            $client = new Client();
        }
        $request = $client->get($url);
        $response = $request->getBody()->getContents();

        return $response;
    }
protected function connect($url, $headers = null)
    {
        if (!empty($headers)) {
            $client = new Client(['headers' => $headers]);
        }
        else {
            $client = new Client();
        }
        $request = $client->get($url);
        $response = $request->getBody()->getContents();

        return $response;
    }
protected function connect ( $ url , $ headers = null ) { if ( ! empty ( $ headers ) ) { $ client = new Client ( [ 'headers' => $ headers ] ) ; } else { $ client = new Client ( ) ; } $ request = $ client -> get ( $ url ) ; $ response = $ request -> getBody ( ) -> getContents ( ) ; return $ response ; }
Connect to the providers API

@param string $url
@param array $headers

@return string
Connect to the providers API