gpt4 book ai didi

google-drive-api - 谷歌驱动器 API : receive push notifications on local environment

转载 作者:行者123 更新时间:2023-12-04 10:46:45 25 4
gpt4 key购买 nike

我有兴趣从 google drive api 接收更改通知。

为了接收通知,您必须使用必须接收通知的地址发出 http 请求:

例子:

POST https://www.googleapis.com/drive/v3/changes/watch
Authorization: Bearer auth_token_for_current_user
Content-Type: application/json

{
"id": "4ba78bf0-6a47-11e2-bcfd-0800200c9a77", // Your channel ID.
"type": "web_hook",
"address": "https://somedomain.com/notifications", // Your receiving URL.
...
"token": "target=myApp-myChangesChannelDest", // (Optional) Your channel token.
"expiration": 1426325213000 // (Optional) Your requested channel expiration time.
}

如您所见,我正在设置 Google 在 "https://somedomain.com/notifications" 发送推送通知。

不过,我在本地/开发行为环境中,我需要在我的本地 ip 上接收通知。

还有其他选择吗

最佳答案

你可以使用类似 ngrok 的东西, 或 localtunnel .要安装它们,只需点击它们的链接即可。

它们允许您公开您的 localhost向全世界进行测试。

Ngrok 示例:ngrok http <local-server-port>

本地隧道示例:lt --port <local-server-port>

关于google-drive-api - 谷歌驱动器 API : receive push notifications on local environment,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59670941/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com