【问题标题】:Firebase CLI: How to send body in POST request?Firebase CLI:如何在 POST 请求中发送正文?
【发布时间】:2019-08-25 07:25:32
【问题描述】:

我之前能够在 Firebase CLI 中附加 POST 请求的正文,但文档缺少任何如何再次执行此操作的示例。

例子:

我试试:

myFunction.post({body: {...}})

但收到以下错误:

TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string or Buffer. Received type object

我想访问通过req.body 传递的数据。有什么想法吗?

【问题讨论】:

    标签: firebase google-cloud-firestore google-cloud-functions


    【解决方案1】:

    Found the answer here

    就我而言,我会这样做:

    myFunction.post().json({...})
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-12-22
      • 2022-01-21
      • 1970-01-01
      • 2019-05-16
      • 2018-06-19
      • 2020-05-23
      • 1970-01-01
      • 2017-11-18
      相关资源
      最近更新 更多