Rapidwebltd / php-google-contacts-v3-api simplexml_load_string()错误:打开和结束标签不匹配:元行1和标题

时间:2019-02-01 09:22:56

标签: php laravel google-contacts

检索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);

这里是$ 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>

0 个答案:

没有答案