通过 API PUT 请求更新帖子

在 API 文档 中存在一点出入:

文档中说明:使用 PUT /posts/{id}.json 并附带以下负载:

Content type: application/json

{
  "post[raw]": "string",
  "post[raw_old]": "string",
  "post[edit_reason]": "string",
  "post[cooked]": "string"
}

但实际上,该格式仅在 PUT /posts/{id} 且 Content-Type: application/x-www-form-urlencoded 时有效。

PUT /posts/{id}.json 的正确负载应为:

Content type: application/json

{
  "post": {
      "raw": "string",
      "raw_old": "string",
      "edit_reason": "string",
      "cooked": "string"
    }
}

只需提供 raw 参数即可替换整个帖子。