【发布时间】:2016-03-21 10:57:19
【问题描述】:
周一快乐,
我正在使用 TwiML 使用 Meteor 和 Twilio 构建一个非常简单的应用程序(用于发送 SMS)。
但是,我被困住了:我不知道如何使用换行符发送响应(类似于 html <br>)。
在我的简单函数下面:
function xyz(message) {
response.setHeader('Content-Type', 'application/xml');
response.statusCode = 200;
var toSend = "<Response><Message>" + message + "</Message></Response>";
response.end(toSend);}
toSend 是这样的:
<Response>
<Message>The quick brown fox jumps over the lazy dog. Portez ce vieux whisky au juge blond qui fume</Message>
</Response>
而我想得到(例如):
<Response>
<Message>The quick brown fox jumps over the lazy dog.
Portez ce vieux whisky au juge blond qui fume
</Message>
</Response>
而且我不能使用\n 或[CDATA] 来使用<br>。
我尝试使用 XMLbuilder (https://atmospherejs.com/meteor/xmlbuilder)。 但我没能成功..
【问题讨论】:
标签: xml meteor newline twilio twilio-twiml