我目前正在尝试将一个统一应用程序链接到门户Azure中的bot消息端点。要做到这一点,我使用一个UnityWebRequest.GET调用,如Unity (https://docs.unity3d.com/Manual/UnityWebRequest-RetrievingTextBinaryData.html)中所解释的那样。
事实上,我在启动应用程序时总是遇到同样的问题:The HTTP 'GET' method is not supported by the 'GenericJsonWebHookReceiver' WebHook receiver
我不知道为了解决这个问题,我必须如何或在哪里作出改变。有谁面临同样的问题吗?
这是我的代码:
IEnumerator GetText()
{
UnityWebRequest www = UnityWebRequest.Get("<messaging endpoint of the bot>");
yield return www.Send();
if (www.isError)
{
Debug.Log(www.error);
}
else
{
// Show results as text
Debug.Log(www.downloadHandler.text);
// Or retrieve results as binary data
byte[] results = www.downloadHandler.data;
}
}发布于 2017-07-07 17:57:23
您所看到的错误与Unity没有任何关系,但是https://[YourBotId].azurewebsites.net/api/messages不能通过Get调用,它是Post方法。如果您导航到浏览器中的/api/messages路径,您将看到相同的错误消息。

您是否尝试过将一个活动发布到消息端点?
我还没有试过这个,但也许它能帮上你:https://github.com/tompaana/bot-direct-line-for-unity
https://stackoverflow.com/questions/44967559
复制相似问题