Hi,
I have a endpoint “https://kitchenno1ct.com/wp-json/insmeal/order_api/updateonneworders“, which I can access directly from web, and curl.
However, when I am using httprequest, I received 406 error, below is a snippet of my code.
Please advise on where I made problem?
Thanks,
Jun
console.log("online order: " + JSON.stringify(data))
let url = _storeinfo.web_url + "order_api/updateonneworders";
console.log("ep: " + url)
var request = HttpRequest
.get(url)
//.set('Content-Type', 'application/json; charset=UTF-8')
//.set('Accept', '*/*')
//.send(data)
.timeout(_http_timeout)
.then(function(res) {
console.log("body: " + JSON.stringify(res.body) ) // keep JSON result
populateModel(res.body, _storeinfo.web_url)
})
.catch(function(err) {
console.log(err.message)
//console.log(err.response)
console.log("err: " + JSON.stringify(err))
});