我想通过api创建一个话语主题。我正在为此使用节点js
我出错了
{"action":"create_post","errors":["Title can't be blank","Title is too short (minimum is 15 characters)","Title seems unclear, is it a complete sentence?"]}
我的代码
var request = require("request");
var options = { method: 'POST',
url: 'https://url/posts',
headers:
{
'cache-control': 'no-cache',
'content-type': 'multipart/form-data',
'Api-Key': 'api key',
'Api-Username': 'username'
},
formData:
{ title: 'TItle more than 15 chars ssssssssssssssssssssssssssssss' ,
raw: 'sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss'
created_at: '2019-10-07',
} };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
当我尝试使用邮递员时,我创建了主题。但是它不能通过node工作。我不知道我在犯什么错误