Azure 移动应用程序 - 未提供要插入的项目

Azure Mobile Apps - An item to insert was not provided

我正在尝试在我的 nodeJS 自定义 Azure 移动应用程序后端上创建一个新的 table。 table 被称为 readings.js:

var azureMobileApps = require("azure-mobile-apps");
var table = azureMobileApps.table();
table.columns = {
    "text": "string",
    "complete": "boolean"
};
module.exports = table;

app.js:

var express = require("express");
var azureMobileApps = require("azure-mobile-apps");
var app = express();

var mobileApp = azureMobileApps({
    homePage: true,
    swagger: true
});

mobileApp.tables.import("./tables");

mobileApp.tables.initialize()
    .then(function () {
    app.use(mobileApp); // Register the Azure Mobile Apps middleware
    app.listen(process.env.PORT || 3000); // Listen for requests
});

然而,这是我在 POST 访问 API 时得到的回复:

为什么会出现这个错误?

您似乎正在本地环境中开发 Azure 移动应用程序。这里有一个 post 在相同的场景中指导你如何做。可以参考详细资料。

关于您的问题,post 数据通过 POSTMAN,请尝试 select body 选项卡中的 raw 单选按钮,以及 select JSON内容类型,那么直接在textare中写入json对象。

如有任何疑问,请随时告诉我。