代码之家  ›  专栏  ›  技术社区  ›  Patrick

使用Firebase云消息REST API-“status”:“UNAUTHENTICATED”

  •  0
  • Patrick  · 技术社区  · 7 年前

    <cfhttp method="post" url="https://fcm.googleapis.com/v1/projects/myapp_name/messages:send" 
                    result="httpResponse">  
    
        <cfhttpparam type="header" name="Content-Type" value="application/json" />
        <cfhttpparam type="header" name="Authorization" value="#serverkey#" />
        <cfhttpparam type="body" value="#serializeJSON(stFields)#">
    </cfhttp> 
    

    我得到一个 "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. 回应。我试过firebase控制台上列出的每一个键 serverkey . 我发错标题了吗?

    0 回复  |  直到 7 年前