APIM 响应 Headers Azure 门户、开发人员门户和 Postman 之间存在差异

APIM Response Headers Different Between Azure Portal, Developer Portal and Postman

我正在学习 Azure API 管理并看到 Azure 门户、开发人员门户和 Postman 之间的不同响应headers。

我正在此端点上执行 HTTP Get: https://secondattempt.azure-api.net/speakers

使用 https://conferenceapi.azurewebsites.net/ 作为 Web 服务 URL。

我在这里比较了它们:

Azure 门户:

  1. Cache-Control
  2. 编译指示
  3. Transfer-Encoding
  4. Content-Type
  5. 过期
  6. Set-Cookie (不存在)
  7. 日期
  8. Op-Apim-Trace-Location
  9. 变化

开发者门户:

  1. Cache-Control
  2. 编译指示
  3. Transfer-Encoding
  4. Content-Type
  5. 过期
  6. Set-Cookie
  7. 日期
  8. Ocp-Apim-Trace-Location
  9. 变化 (不存在)

邮递员:

  1. Cache-Control
  2. 编译指示
  3. Transfer-Encoding
  4. Content-Type
  5. 过期
  6. Set-Cookie
  7. 日期
  8. Ocp-Apim-Trace-Location (不存在)
  9. 变化 (不存在)

下面是它们在 UI 中的实际样子:

Azure 门户:

开发者门户:

邮递员:

为什么某些 headers 存在于某些环境中而其他环境中不存在?

另外,为什么 headers 出现的顺序不同?

  1. 对于 Postman(Ocp-Apim-Trace-Location 不存在)

    OCP-Apim-Trace 功能使您能够指定 APIM 是否应在 blob 存储上生成跟踪文件。

    从 Postman 发出 GET 请求时,OCP-Apim-Trace 未启用。

    例如,在 Postman 中将 header 设置为 'true',将在名为 OCP-Apim-Trace-Location 的响应中返回一个 HTTP Header。

    这将包含您的跟踪文件的 URL,您可以在任何浏览器中打开它。

  2. 对于 Postman 和开发人员门户(不重新发送)

    一个请求没有被缓存。 URL 的每个请求都应该被视为唯一且不可缓存的请求。

  3. 对于 Azure 门户(Set-Cookie 不存在)

    查看 Trace 然后转发请求我们确实看到 "name": "Set-Cookie", "value": "ARRAffinity