rapidwebltd / php-google-contacts-v3-api simplexml_load_string () ошибка: несоответствие открытия и окончания тега: мета-строка 1 и заголовок - PullRequest
0 голосов
/ 01 февраля 2019

Получение контактов Google Simplexml_load_string (): ошибка.

Как я могу решить эту проблему, вот мой код.

$client = GoogleHelper::getClient($customConfig);

    $req = new \Google_Http_Request('https://www.google.com/m8/feeds/contacts/default/full?max-results=10000&updated-min=2007-03-16T00:00:00');

    $val = $client->getAuth()->authenticatedRequest($req);

    $response = $val->getResponseBody();

    $xmlContacts = simplexml_load_string($response);

Вот данные ответа $.

dd($ response);

<html><head><meta http-equiv="Content-Type" content="text/html; 
charset=utf-8">\n
<title>Error\n
401\n
(Client Error)!!1</title>\n
<style type="text/css">\n
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{background:url(data:image/png;base64,iV ▶
  </style></head>\n
<body><a href="//www.google.com/" id="g"><img 
src="//www.google.com/images/logo_sm_2.gif" alt="Google" width="150" 
height="55"></a>\n
<p><b>401.</b>\n
<ins>That&#39;s an error.</ins></p>\n
<p>There was an error in your request.\n
<ins>That&#39;s all we know.</ins></p></body></html>
...