我正在使用copy2contact rest Api,它在每次重新加载或刷新时都会针对相同的输入文本给出不同的响应。
http://www.copy2contact.com/api/rest.php
ob_start();
$text = "John Smith
123 Spruce Ln.
Boston, MA 01234
cell: 676-144-8901
johnjohn7202@gmail.com";
$text = urlencode($text);
$url = "https://api.copy2contact.com/rest/json/ParseContact?text=" . $text . "&emu&authid=1329&pass=123456";
$curl_request = curl_init();
curl_setopt($curl_request, CURLOPT_URL, $url);
curl_setopt($curl_request, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($curl_request);
$http_code = curl_getinfo($curl_request, CURLINFO_HTTP_CODE);
if ($http_code == 200) {
$xml = simplexml_load_string($result);
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo $result;
curl_close($curl_request);
ob_end_flush();
} else {
$http_message = curl_error($curl_request);
var_dump('Error: "' . $http_message . '" having error code ' . $http_code);
return '';
}
响应: “{” 结果 “:{” ContactPreNameTitle “:””, “联系人姓名”: “Smitv”, “ContactFirst”: “雅恩”, “ContactMiddle”: “”, “ContactPostNameTitles”: “”, “联系人头衔”: “” ,“ContactCompany”:“”,“ContactAddress”:“722 Spruce ............”
当我重新加载时,响应会发生变化。 即“{”result“:{”ContactPreNameTitle“:”“,”ContactName“:”Smpth“,”ContactFirst“:”Rohn“,”ContactMiddle“:”“,”ContactPostNameTitles“:”“,”ContactTitle“: “”,“ContactCompany”:“”,“ContactAddress”:“023 Sqruce ..............”
答案 0 :(得分:1)
如有任何其他问题,请随时与我们联系。