【问题标题】:How to Create a comment using WP Rest API v2?如何使用 WP Rest API v2 创建评论?
【发布时间】:2021-09-24 09:24:25
【问题描述】:

我正在尝试使用POST 请求通过 WP Rest APi v2 创建新评论,该请求对以下网址:

https://www.turboweb.online/wp-json/wp/v2/comments?author_email=admin@admin.com&author_name=alex bhati&content=nice post&post=4002

但是,这是我每次得到的响应:

{
    "code": "rest_forbidden_param",
    "message": "Query parameter not permitted: author_email",
    "data": {
        "status": 401
    }
}

【问题讨论】:

    标签: json wordpress wordpress-rest-api


    【解决方案1】:

    author_email 字段需要授权才能添加,也许这个答案会有所帮助:WP Rest API not allowing to post anonymous comments through a Laravel request

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-10-29
      • 2018-01-09
      • 2018-01-29
      • 2017-12-15
      • 2017-11-28
      • 2015-03-02
      • 1970-01-01
      相关资源
      最近更新 更多