如何仅使用api键发布到发布/订阅

编程入门 行业动态 更新时间:2024-10-28 10:23:58
本文介绍了如何仅使用api键发布到发布/订阅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要使用POST请求将消息发布到GCP发布/订阅,因为我使用的平台(Zoho)不允许使用任何GCP库.我不确定如何以简单的方式发出请求,因为普通的身份验证系统似乎很复杂.

I need to publish messages to GCP Pub/Sub with a POST request as the platform I'm using (Zoho) does not allow for any of the GCP libraries. I'm not sure how to make the request in a simple way, as the normal authentication system seems complex.

  • 是否有一种简单的方法可以使用例如API密钥发布消息?

  • Is there an easy way to publish a message using, e.g., an API key?

    或者有一种简单的方法可以在GCP中创建一个API端点,然后我可以将其转发到消息传递系统上.

    Alternatively is there a simple way to create an API endpoint within GCP that I can then forward data on to the messaging system?

    我已经使用python客户端发布到Pub/Sub,但是由于身份验证问题而无法发出POST请求.

    I have used the python client to publish to Pub/Sub, but cannot make POST requests because of the authentication issues.

    推荐答案

    您的两个问题都有相同的答案,是的,Google Cloud Endpoints是您的解决之道.

    Both of your questions will have the same answer, yes, and Google Cloud Endpoints is your way to go here.

    使用Google Cloud Endpoints,您可以创建自定义终结点并使用API​​密钥来验证正在执行的请求.从中,有一个非常好的操作指南a>您可以按照以下步骤设置端点和发布/订阅推送订阅.

    With Google Cloud Endpoints you can create a custom endpoint and use API keys to authenticate the requests that are being done. There's a really good how-to guide from medium you can follow in order to set up your endpoint and your Pub/Sub push subscription.

    有关创建推送订阅的更多信息,请参见公共文档.

    More information about creating push subscriptions can be found in the public documentation.

  • 更多推荐

    如何仅使用api键发布到发布/订阅

    本文发布于:2023-10-11 13:59:58,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1481898.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:api

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!