【问题标题】:how can I use google product search api?如何使用谷歌产品搜索 API?
【发布时间】:2020-09-14 12:56:36
【问题描述】:

我是编程初学者,对 Python 的经验很少,但它是初级水平。

我正在尝试使用 Google 云视觉产品搜索 API 制作网络应用程序。

我尝试按照 google 上的操作指南进行操作,但我完全看不懂 Creating a product set section

首先我尝试在 python 类别中使用代码,但我无法理解它是如何工作的。

它还显示类似的命令

HTTP 方法和 URL:

POST https://vision.googleapis.com/v1/projects/project-id/locations/location-id/productSets

请求 JSON 正文:

{
  "displayName": "display-name"
}

我在 Cloud Shell 中尝试过这个,但它不起作用。

我根本不知道在哪里以及如何输入这些命令。

请回答如何使用这些命令。 谢谢你。

【问题讨论】:

  • 如果您在 Python 中执行此操作,您可能希望查看 Requests 库。

标签: python api curl command google-product-search


【解决方案1】:

您可以尝试这样的示例(替换为您的项目和所需位置)

curl -s -d "{ display_name: 'your display name' }" "https://vision.googleapis.com/v1/projects/your_project/locations/us-west1/productSets?product_set_id=your_set_id" -H "Content-Type: application/json" -H "Authorization: Bearer $(gcloud auth print-access-token)";

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-02-22
    • 1970-01-01
    • 1970-01-01
    • 2014-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-22
    相关资源
    最近更新 更多