response detail error:2,errMsg:post method api body check failed! Agora REST API

response detail error:2,errMsg:post method api body check failed! Agora REST API

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!'
}

您应该将 header 作为 object 与他们的授权密钥一起传递,在您的情况下:

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

这意味着您已成功获得授权,但您传递了错误的值,或者它未在您的正文或 URL 中定义。 请检查您传递的任何变量是否未定义或包含 wrong/incomplete 值。