Categories
Tags
Description
Faces
ImageType
Color
Adult
const https = require("https");
const param =
"?visualFeatures=Categories,Faces,Tags,Description,ImageType,Color,Adult&language=en";
const options = {
host: "eastasia.api.cognitive.microsoft.com",
port: 443,
path: `/vision/v1.0/analyze${param}`,
method: "POST",
headers: {
"Ocp-Apim-Subscription-Key": "填上金鑰"
}
};
const req = https.request(options, res => {
res.on("data", function(data) {
console.log(data.toString());
});
});
req.on("error", e => {
console.error(e);
});
req.write(
JSON.stringify({
url: "https://desk-fd.zol-img.com.cn/t_s960x600c5/g5/M00/0B/05/ChMkJ1aCHsGIF_JuABN-S6sntcUAAGskAMO8d4AE35j534.jpg"})
);
req.end();