【问题标题】:Query parameter in twilio action urltwilio 操作 url 中的查询参数
【发布时间】:2017-03-21 21:39:29
【问题描述】:

我正在尝试通过 twilio 的 Record 动词操作 url 传递数据。当有两个或多个查询字符串参数时失败,但当只有一个时成功。

成功:

var response = '<Response><Say>STUFF TO SAY</Say><Pause length="1"/><Record maxLength="3600" timeout="30" action="/service/training/call/recording?test1=test&test2=test"></Record></Response>';

失败:

  var response = '<Response><Say>STUFF TO SAY</Say><Pause length="1"/><Record maxLength="3600" timeout="30" action="/service/training/call/recording?test1=test"></Record></Response>';

错误:

Error on line 1 of document  : The reference to entity "test2" must end with the ';' delimiter. 

有没有办法可以通过查询字符串传递数据,或者我必须求助于使用 url 参数? "/service/training/call/recording/test/test

【问题讨论】:

    标签: node.js twilio twilio-api


    【解决方案1】:

    Twilio 支持回复了我。这是他们的回应。

    解决方法是将代码中的“&”替换为有效的 XML 替换 - “&”。所以你的 TwiML 看起来像这样:

    <?xml version="1.0" encoding="UTF-8"?>
    <Response>
      <Say>STUFF TO SAY</Say>
      <Pause length="1"/>
      <Record maxLength="3600" timeout="30" action="/service/training/call/recording?test1=test&amp;test2=test">
      </Record>
    </Response>
    

    【讨论】:

      猜你喜欢
      • 2016-06-22
      • 1970-01-01
      • 1970-01-01
      • 2015-11-14
      • 1970-01-01
      • 2015-03-13
      • 2014-11-07
      • 2017-06-18
      • 2017-11-15
      相关资源
      最近更新 更多