【发布时间】:2016-06-10 21:58:37
【问题描述】:
我正在尝试使用 Google Vision API。我在关注getting started guide:
- 我已启用 Cloud Vision API
- 我已启用结算功能
- 我已设置 API 密钥
- 根据我的图像制作 base64 编码数据
-
使用设置制作 JSON 文件:
{ "requests":[ { "image":{ "content":"my base64-encoded data" }, "features":[ { "type":"LABEL_DETECTION", "maxResults":5 } ] } ] } -
使用
curl发送请求:$ curl -v -k -s -H "Content-Type: application/json" https://vision.googleapis.com/v1/images:annotate?key=my_browser_key --data-binary @path_to_file.json
之后我得到了回复:
{
"error": {
"code": 403,
"message": "Requests from referer \u003cempty\u003e are blocked.",
"status": "PERMISSION_DENIED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"description": "Google developer console API key",
"url": "https://console.developers.google.com/project/***********/apiui/credential"
}
]
}
]
}
}
\u003cempty\u003e 表示
有什么想法吗?有人有同样的问题吗?
【问题讨论】: