请求体

按内容类型解析请求体。带类型的端点只接受自己的 Content-Type(否则返回 415),并报告解析结果;/any 会识别内容格式;/large 可测量最大 10MB 的上传。

你的账号已解锁这些端点。在每个端点的页面上用 Try it 发送请求。

这些端点需要一个免费账号。创建账号或登录即可查看详情并在这里试用。

请求示例

Detects a body's real type from its content and compares it with the declared Content-Type. 完整参考和 Send 按钮(英文).

cURL
curl -X POST "https://api.testingapis.com/api/bodies/any" \
  -H "Content-Type: application/json" \
  -d '{"hello": "world"}'
响应 · 200 OK
{
  "method": "POST",
  "declaredContentType": "application/json",
  "detectedType": "application/json",
  "matchesDeclared": true,
  "length": 18,
  "sha256": "5f8f04f6a3a892aaabbddb6cf273894493773960d4a325b105fee46eef4304f1"
}

登录后查看详情

这些端点的参数、请求和响应示例以及实时 Try it 面板仅对已登录的成员开放。账号免费,几秒钟就能创建。