VeeShostak/react-native-ai-chat-hybrid

make a POST request to a DialogFlow's REST API

Closed this issue · 0 comments

fetch("https://api.api.ai/api/query?v=20150910", {
method: "POST",
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer DEVELOPER_ACCESS_TOKEN',
'charset': "utf-8"
},
body: JSON.stringify(data)
})
.then(function(response) {
var json = response.json().then(function(res){
console.log('---rrr--',res)
})
})
.then(function(data) {
console.log(data)
});

}, error=>console.log(error))