嘿,我正在尝试对wordpress博客文章发表评论,但收到错误消息:
“响应正文:{”代码”:“ rest_comment_content_invalid”,“消息”:“无效的注释内容。”,“数据”:{“状态”:400}}“
Map data = {
"post": 47,
"author_name": "peter",
"author_email": "test@outlook.com",
"content": "test comment",
};
void postData() async {
final String apiUrl =
"https://hui.bplaced.net/wordpress/wp-json/wp/v2/comments?post=47";
var res = await http.post(apiUrl, body: json.encode(data)).then((response) {
print("Response status: ${response.statusCode}");
print("Response body: ${response.body}");
});
print('ok');
}
答案 0 :(得分:0)