bom序言中的.NET REST API导致Twilio Parse错误12100

发布于 2025-01-28 18:11:05 字数 892 浏览 3 评论 0原文

我们有一个.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.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文