【问题标题】:response detail error:2,errMsg:post method api body check failed! Agora REST APIresponse detail error:2,errMsg:post method api body check failed!集市 REST API
【发布时间】:2022-01-01 03:33:30
【问题描述】:
const Authorization = `Basic ${Buffer.from(`${config.CUSTOMERID}:${config.CUSTOMER_SECRET}`).toString("base64")}`;
const acquire = await axios.post(`https://api.agora.io/v1/apps/${config.agoraAppId}/cloud_recording/acquire`,{
                          cname: groupId,
                          uid: userId,
                          clientRequest: {
                          },
                        },
                        { headers: { Authorization } }
                      );

当我使用 axios 从 nodejs 代码调用 agora 直播云录制时得到以下响应。

{
 code: 2,
 reason: 'response detail error:2,errMsg:post method api body check failed!'
}

【问题讨论】:

    标签: node.js api axios agora.io


    【解决方案1】:

    在您的情况下,您应该将标头作为带有授权密钥的对象传递:

    {
       headers: {'Authorization': "Basic " + Authorization}
    }
    

    【讨论】:

      猜你喜欢
      • 2013-10-13
      • 2022-12-01
      • 2014-02-01
      • 2021-02-05
      • 2022-11-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-02
      相关资源
      最近更新 更多