Unity用C# sdk报错WebExcepti
eastladder 发布于2018-12 浏览:1044 回复:1
1
收藏

在Unity里写了以下代码:

ImageClassify client = new Baidu.Aip.ImageClassify.ImageClassify(API_KEY, SECRET_KEY);
client.Timeout = 60000;
filePath = Application.dataPath + "/Resources/Image/apple.jpg";
byte[] bytes = File.ReadAllBytes(filePath);
client.AdvancedGeneral(bytes);

出现以下报错:

WebException: Error writing request: The authentication or decryption has failed.
System.Net.WebConnectionStream.WriteHeaders ()
System.Net.WebConnectionStream.SetHeaders (System.Byte[] buffer)
(wrapper remoting-invoke-with-check) System.Net.WebConnectionStream:SetHeaders (byte[])
System.Net.HttpWebRequest.SendRequestHeaders (Boolean propagate_error)
UnityEngine.EventSystems.EventSystem:Update()

我检查了API_KEY和SECRET_KEY应该没错,我漏了什么?求解决,感谢!

收藏
点赞
1
个赞
共1条回复 最后由chenxiaoyu3回复于2019-01
#2chenxiaoyu3回复于2019-01

可能是网络有代理,https不安全导致的

0
TOP
切换版块