【问题标题】:Is it possible to send bearer access token through webhooks? If not how can I do it through code?是否可以通过 webhook 发送不记名访问令牌?如果不是,我怎么能通过代码做到这一点?
【发布时间】:2018-12-18 06:09:13
【问题描述】:

我在 nodejs 中有以下代码,但 zapier 不支持请求模块。 使用 fetch 或标准 http 方法,这可以在我的 zap 中实现吗?

request(
  {
    url: "https://wechat.com/",
    auth: {
      bearer: accessToken
    }
  },
  function(err, res) {
    //do something
  }
);

【问题讨论】:

    标签: node.js zapier


    【解决方案1】:

    David 来自 Zapier 平台团队。是的,fetch 非常简单。

    您需要将Authentication 标头设置为bearer mytoken

    const myToken = "ABCD";
    
    const response = await fetch("https://self.wavity.net/scim/doc/", {
      headers: { Authentication: `bearer ${myToken}` }
    });
    

    如果需要,您还可以使用base-64 库对令牌进行编码,如here 所述。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-05
    • 2013-10-09
    • 2018-04-04
    • 2021-01-07
    相关资源
    最近更新 更多