![](/img/trans.png)
[英]Do I have to enable Firebase if I want to connect to my Cloud Firestore database from outside of Google cloud products?
[英]I want connect Google Cloud Vision to my flutter app
我想将 google cloud Vision 连接到我的 flutter 应用程序
这是我的代码
import 'package:dio/dio.dart';
const _apiPREFIX = "https://vision.googleapis.com";
class Server {
Future<void> postReq() async {
Response response;
Dio dio = Dio();
Map<String, dynamic> data = {
"requests": [
{
"image": {
"source": {
"imageUri":
"https://image.msscdn.net/images/goods_img/20200729/1530505/1530505_2_500.jpg?t=20210902101946"
}
},
"features": [
{"type": "LABEL_DETECTION", "maxResults": 1}
]
}
]
};
try {
response = await dio.post(
"$_apiPREFIX/v1/images:asyncBatchAnnotate?key=(my api key)",data: data
);
print(response.data.toString());
} catch (e) {
print(e);
}
}
}
Server server = Server();
我有谷歌 Api 密钥,但如何使用此密钥
我收到 403 错误,我该如何解决这个问题,,,
请帮忙
也许您应该使用这个 package 来检索身份验证令牌并将其传递到请求中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.