来自谷歌智能家居SDK的请求为空

问题描述 投票:1回答:1

我正在创建Web服务器,将我的DIY智能家居设备连接到Google Home应用。

在授权和token请求后,Google服务器向fullfillment URL发出POST请求,但由于某些原因,请求是空的。根据文档,它必须是SYNC请求,但它不包含任何值,甚至请求ID。

在我的服务器上出现了错误 "无法更新设置。请检查您的互联网连接。"在我的手机上请求后。

那么为什么会发生这种情况,我该如何解决?

const app=smarthome({ debug: true, });

app.onSync( async (body) => {
    return {
        requestId: body.requestId,
        payload: {
            agentUserId: "agentUserId",
            devices                       // devices list
        }
    };
});

server.post("/request", app);
node.js actions-on-google google-smart-home
1个回答
0
投票

哦,我忘了包括 body-parser 因为我用的是一般的网络服务器,而非 actions-on-google API。LOL

案件结束。

© www.soinside.com 2019 - 2024. All rights reserved.