我目前正在爲Unity應用程序鏈接到門戶Azure中我的機器人消息端點。要做到這一點,我使用的是UnityWebRequest.GET電話與在Unity DOC(https://docs.unity3d.com/Manual/UnityWebRequest-RetrievingTextBinaryData.html)解釋。UnityWebRequest和天青和博特問題
事實是,我總是遇到同樣的問題,當我啓動應用程序: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;
}
}
謝謝大家的幫助,這些細節是非常模糊了我。不幸的是,我在嘗試實現GitHub鏈接到我的項目時遇到了問題。 我發現了另一種方法來執行我想要的技能,但我不知道如何從在線Azure控制檯添加NuGet包:有沒有辦法做到這一點? –
如果您的機器人是使用Azure Bot服務創建的,則可以在kudi中編輯project.json以添加nuget包。 https:// [YourSiteName] .scm.azurewebsites.net/DebugConsole /?shell = powershell然後導航到site/wwwroot/messages /然後編輯project.json並添加nuget包。 –
它工作正常,謝謝! –