Firebase CLI:如何在POST请求中发送正文?

问题描述 投票:0回答:1

我以前能够在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个回答
2
投票

Found the answer here

在我的情况下,我会这样做:

myFunction.post().json({...})
© www.soinside.com 2019 - 2024. All rights reserved.