New in 2.4: Test runs you can trust See what's new →

API 版本控制

常见形式的 API 版本控制。同一份资料以两种形式返回:v1(已弃用:扁平字段;发送 Deprecation / Sunset / Link successor-version 响应头)和 v2(嵌套)。通过 URL 路径(/api/v1、/api/v2)选择版本,或在 /api/versioned/profile 上通过 X-API-Version 请求头、?api-version= 查询参数或 Accept: application/vnd.apibee.v2+json 选择(按此顺序检查)。

请求示例

Get the profile in the deprecated v1 shape (selected by URL path). 完整参考和 Send 按钮(英文).

cURL
curl -X GET "https://api.testingapis.com/api/v1/profile"
在 Studio 中运行
响应 · 200 OK
{
  "id": 101,
  "name": "Ava Thompson",
  "email": "ava.thompson@example.com",
  "phone": "+1-555-0101",
  "address": "742 Evergreen Terrace, Springfield, IL 62704, USA",
  "memberSince": "2023-04-12"
}