我收到一个解析错误:
12100 Document parse failure
Description:vError on line 1 of document : Premature end of file. Please ensure that the response body is a valid XML document.
我不确定为什么会发生此错误。我的代码如下。你能告诉我这个错误的根本原因是什么。
<?php
header("content-type: text/xml");
require "twilio-php-latest/Services/Twilio.php";
$server= "http://ea3473a.ngrok.com";
/* Set our AccountSid and AuthToken */
$AccountSid = "AC043519349d0042fc190fe61870e591cd";
$AuthToken = "19b05608d0e1b9b7ccda615f6620f388";
$caller=$_REQUEST['From'];
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$from= "+17864310795";
$client = new Services_Twilio($AccountSid, $AuthToken);
try {
$to = $caller;
$url = $server.'/trial.php';
$client->account->calls->create(
$from,
$to,
$url,
array(
'Method' => "GET",
'FallbackMethod' => "GET",
'StatusCallbackMethod' => "GET",
'Record' => "false",
));
} catch (Exception $e) {
// log error
}
?>
<Response>
<Reject reason="busy"/>
</Response>