0

我正在尝试使用 OAuth 凭据登录,这涉及向 Auth verifyAssertion 端点发出 HTTP POST 请求。我将如何在语法上执行此操作?我正在尝试遵循这个 firebase 文档,但他们使用 curls 作为示例。

https://firebase.google.com/docs/reference/rest/auth/#section-sign-in-with-oauth-credential

端点是https://identitytoolkit.googleapis.com/v1/accounts:signInWithIdp?key=[API_KEY]

4

1 回答 1

0

您可以选择本机 fetch api

window.fetch('https://url-you-want-to-post-to.com/', {method: 'POST', body: { //body data } })

或者你可以使用第三方库,比如 axios(虽然你需要先 npm install 再导入)

于 2020-07-22T17:36:05.403 回答