如何从邮递员调用 HTTP 可调用云函数? [英] how can i call HTTP callable cloud function from postman?
本文介绍了如何从邮递员调用 HTTP 可调用云函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道我可以从邮递员软件中调用云功能吗?当我从邮递员调用 CF 时,它总是给我
I want to know that can i call cloud function from postman software .When i'm calling CF from postman it always give me
"error": {
"status": "INVALID_ARGUMENT",
"message": "Bad Request"
}
推荐答案
使用@Vaaljan 的回答,我能够对我使用HTTP 触发方法创建的需要身份验证的GCP 云函数进行身份验证:
Using @Vaaljan's answer I was able to authenticate a GCP cloud function that I created using the HTTP trigger method with authentication required:
gcloud auth print-identity-token
然后将其添加到请求授权头中:
Then added it to the request Authorization header:
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6I ... bnRzLmdvb2dsZS5jb20i
在邮递员中:
这篇关于如何从邮递员调用 HTTP 可调用云函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文