我尝试使用 Azure Sphere 公共 API:设备组 -使用 Node.js删除。
但我收到错误消息:Error occurred while deleting deviceGroup --- for tenantId ---
。(---:我的租户/设备组 ID)
但是“设备组 - 获取”方法效果很好。下面是部分测试代码。
const config = {
url: `https://prod.core.sphere.azure.net/v2/tenants/${tenantId}/devicegroups/${groupId}`,
headers: {
Authorization: `Bearer ${token}`
},
method: "DELETE"
};
try {
const resp = await axios(config);
console.log("resp:", resp);
} catch (error) {
console.error(error);
}
在配置中,当我将方法更改为“GET”时,它可以工作。但是当使用“DELETE”方法时,出现了错误。
请检查这个。