向cloudsight api发送请求时出现以下错误
{"error":{"image":["至少必须设置 image 或 remote_image_url 之一"]}}
你能告诉我缺少什么吗?
代码片段:
var xhr = new XMLHttpRequest();
var url = "http://api.cloudsightapi.com/image_requests";
xhr.open("POST", url, true);
xhr.setRequestHeader('Content-type', 'application/json');
xhr.setRequestHeader('authorization', 'CloudSight <MY_API_KEY>');
xhr.setRequestHeader('cache-control', 'no-cache');
xhr.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var myArr = JSON.parse(this.responseText);
alert(http.responseText);
}
};
xhr.send(JSON.stringify({"remote_image_url":"http://englishbookgeorgia.com/blogebg/wp-content/uploads/2015/08/husky.jpg" ,"locale":"en_US"}));