Flutter Wordpress API POST->无效的评论内容

时间:2018-10-30 08:20:03

标签: wordpress flutter

嘿,我正在尝试对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');
}

1 个答案:

答案 0 :(得分:0)