【发布时间】:2017-11-18 00:03:26
【问题描述】:
我正在尝试将图像发送到Face++ Detect API 使用 image_base64 参数。但是我收到一个错误:
414 请求 URI 太大
414 Request-URI Too Large
请求的 URL 的长度超过了此服务器的容量限制。
我正在使用以下代码发出请求:
function sendImageProcess(img_64) {
var url = "https://api-us.faceplusplus.com/facepp/v3/detect";
request({
uri: url,
method: 'POST',
qs: {
api_secret: fpp_pass,
api_key: fpp_key,
return_attributes: "gender",
image_base64: img_64,
return_landmark: "1"
}
},function (error, response) {
if(!error){
console.log(response.body);
return response.body;
}
else{
console.log(error);
}
});
}
这里img_64是图片的base64字符串。
也许,我不明白我需要发送image_base64 参数的方式。
img_64 字符串看起来像:
data:image/jpeg;base64,/9j/4RSJRXhpZgAATU0AKgAAAAgADAEAAAMAAAABAawAAAEBAAMAAAABAn0AAAECAAMAAAADAAAAngEGAAMAAAABAAIAAAESAAMAAAABAAEAAAEVAAMAAAABAAMAAAEaAAUAAAABAAAApAEbAAUAAAABAAAArAEoAAMAAAABAAIAAAExAAIAAAAkAAAAtAEyAAIAAAAUAAAA2Idp.........and so on
我希望有人可以帮助我。
谢谢!
【问题讨论】:
标签: javascript node.js face-detection