0
我想通過javascript(ReactJS)向Wit.ai發出API請求。我的網絡瀏覽器選項卡顯示呼叫失敗消息:Wit.ai客戶端API調用失敗
「錯誤」:「壞身份驗證,檢查令牌/ PARAMS」
然而,相同的呼叫顯示在Wit.ai一樣成功日誌。我已驗證憑證是否正確,並且可以通過終端成功撥打電話。
這裏的電話:
async action() {
const resp = await fetch('https://api.wit.ai/message?v=20160526&q=hello', {
method: 'GET',
headers: {
'Authorization': "Bearer " + accessToken
},
dataType: 'jsonp',
mode: 'no-cors',
credentials: 'include'
}).then(resp => resp.json()).catch(e => console.log('Boo', e));
}