Node.js 与节点js集成的Grammabot api问题
我已经使用node.js作为应用程序的API。在这篇文章中,我使用了npm已经给出的节点包,但它给了我错误的请求。我用npm提供的两种方法进行了尝试Node.js 与节点js集成的Grammabot api问题,node.js,Node.js,我已经使用node.js作为应用程序的API。在这篇文章中,我使用了npm已经给出的节点包,但它给了我错误的请求。我用npm提供的两种方法进行了尝试 const bot = new Grammarbot({ API_key: "XXXXXX", language: "en-US", base_uri: "api.grammarbot.io", }); bot.check("I can't remember how to go their", function (error, res
const bot = new Grammarbot({
API_key: "XXXXXX",
language: "en-US",
base_uri: "api.grammarbot.io",
});
bot.check("I can't remember how to go their", function (error, result) {
if (!error) console.log(JSON.stringify(result));
});
{
"timestamp": "2019-10-10T10:20:38.301+0000",
"status": 400,
"error": "Bad Request",
"message": "Required String parameter 'text' is not present",
"path": "/v2/check"
}
错误就像
{
"timestamp": "2019-10-10T10:20:38.301+0000",
"status": 400,
"error": "Bad Request",
"message": "Required String parameter 'text' is not present",
"path": "/v2/check"
}
我在grammabotnodejs库中做了一些更改,并上传到npm包中。请安装以下软件包并运行
{
"timestamp": "2019-10-10T10:20:38.301+0000",
"status": 400,
"error": "Bad Request",
"message": "Required String parameter 'text' is not present",
"path": "/v2/check"
}
npm i custom-grammar-bot-api --save
有什么错误??另外,为方便调试提供更多输入,并提供从操作中得到的错误信息。添加
console.log(错误)代码>到回调函数。