bom序言中的.NET REST API导致Twilio Parse错误12100
我们有一个.NET REST API,它是Twilio的网络钩。它返回一个Twiliorpsess对象。突然,Twilio在钩子上报告了一个解析错误12100。我们看上去更近了,这似乎是由于BOM序言正在添加到我们的响应中(出于某种原因;此代码多年来没有改变)。
有人知道什么可能导致这个问题突然出现。而且,更重要的是,我该如何解决?
这是Twilio正在调用(并窒息)的HTTPGET方法...
[HttpGet]
[Route("TransferMessage", Name = "GetTransferMessage")]
public TwilioResponse GetTransferMessage()
{
var response = new TwilioResponse();
response.Pause(2);
response.Say("Hello. This call is being transferred by Acme Products and may be recorded " +
"for quality assurance.");
return response;
}
预先感谢...!
这是我们端点返回的XML。如果您查看十六进制编辑器中的原始数据,则显然是用UTF-8-BOM编码的。
We have a .NET Rest API that is a web-hook for Twilio. It returns a TwilioResponse object. Suddenly, Twilio is reporting a Parse Error 12100 on the hook. We looked closer and it seems to be due to a BOM preamble that is getting added to our response now (for some reason; this code hasn't changed in years).
Does anyone know what might cause this problem to suddenly crop up. And, more importantly, how can I fix it?
Here is the HttpGet method that Twilio is calling (and choking on)...
[HttpGet]
[Route("TransferMessage", Name = "GetTransferMessage")]
public TwilioResponse GetTransferMessage()
{
var response = new TwilioResponse();
response.Pause(2);
response.Say("Hello. This call is being transferred by Acme Products and may be recorded " +
"for quality assurance.");
return response;
}
Thanks in advance...!
Here is the xml returned by our endpoint. If you look at the raw data in a hex editor, it's clearly encoded with UTF-8-BOM.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论