> ## Documentation Index
> Fetch the complete documentation index at: https://ayrshare.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 如何修复 400 Bad Request 错误 | Ayrshare API 文档

> 了解 Ayrshare API 返回 Bad Request (400) 错误的原因、如何发现缺失或无效的参数，以及如何更正请求并重新发送。

如果你收到 "Bad Request" 的 HTML 响应而非 JSON，可能是因为 POST body 参数不是有效的 JSON。

例如，发送以下无效 JSON：

```javascript theme={"system"}
{
    "post": "A "great" post"
    "platforms: ["twitter"]
}
```

会返回 "Bad Request" 响应。上面的代码存在三个问题：`post` 缺少逗号、post 文本中的双引号未转义，以及 `platform` 缺少结束引号。正确的 JSON 应为：

```javascript theme={"system"}
{
    "post": "A \"great\" post",
    "platforms": ["twitter"]
}
```

你可以通过向以下 URL POST 你的 JSON 来进行校验。请将 Content-Type 设为 `text/plain`。

我们推荐使用 [Postman](/testing/postman) 尝试此请求，它可以帮助你修正 JSON 格式。详情请见下一节。

## 校验 JSON

你可以使用在线校验工具，例如 [https://jsonlint.com/](https://jsonlint.com/)，或者使用 [Postman](/testing/postman)。

你也可以使用我们的 `/validate/json` 端点：

<Card title="validate" icon="link" href="/apis/validate/overview" horizontal />
