小编sac*_*tav的帖子

.NET Core API 中的 Twilio StatusCallBack & Gather POST 方法返回 HTTP 415 - 不支持的媒体类型

以下是我对这两种方法的代码 -

GatherCall正在返回 Twiml 仍然我得到 HTTP 415 和相同的StatusCallback方法。有人可以在这里帮忙吗?我什至无法使用 ngrok 对此进行测试,因为隧道工具在我的组织网络中不起作用。我正在使用 Azure 通过记录所有内容来测试这个。

public TwiMLResult GatherCall([FromRoute] string id, [FromBody] VoiceRequest voiceRequest )
{
    _logger.LogInformation("*****************GatherCall - Start****************");
    var response = new VoiceResponse();

    try
    {
        _logger.LogInformation("Gather call back for -" + id);

        _logger.LogInformation("VoiceRequest parameters-------------------------");
        _logger.LogInformation("CallSid : " + voiceRequest.CallSid);
        _logger.LogInformation("CallStatus : " + voiceRequest.CallStatus);
        _logger.LogInformation("AccountSid : " + voiceRequest.AccountSid);
        _logger.LogInformation("From : " + voiceRequest.From);
        _logger.LogInformation("To : " + voiceRequest.To);
        _logger.LogInformation("Digits : " + voiceRequest.Digits);
        _logger.LogInformation("Direction : " + voiceRequest.Direction);
        _logger.LogInformation("TranscriptionText …
Run Code Online (Sandbox Code Playgroud)

c# twilio twilio-api asp.net-core-webapi

0
推荐指数
1
解决办法
520
查看次数

标签 统计

asp.net-core-webapi ×1

c# ×1

twilio ×1

twilio-api ×1