我收到此错误:
Invalid value at 'requests[0].image.content' (TYPE_BYTES), "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/...
图像编码正确(它使用另一个需要相同 base64 编码的视觉搜索服务 metamind),这个调用有什么问题?
这是来自 AngularJS$http
服务:
$http({
method: "POST",
data: '{"requests":[{"image":{"content":"' + base64Img + '"},"features":[{"type":"LABEL_DETECTION","maxResults":1}]}]}',
url: "https://vision.googleapis.com/v1/images:annotate?key=mykey27272772277227292992929"
}).success(function (result) {
console.log("SUCCESS");
$scope.results = result;
console.log(result);
}).error(function (err) {
console.log("FAIL");
console.log(err);
});
任何想法?