| 此版本仍在开发中,尚不被认为是稳定的。对于最新的稳定版本,请使用 Spring Boot 3.5.5! | 
HTTP 交换 (httpexchanges)
这httpexchangesendpoint 提供有关 HTTP 请求-响应交换的信息。
检索 HTTP 交换
要检索 HTTP 交换,请将GET请求/actuator/httpexchanges,如以下基于 curl 的示例所示:
$ curl 'http://localhost:8080/actuator/httpexchanges' -i -X GET生成的响应类似于以下内容:
HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 511
{
  "exchanges" : [ {
    "principal" : {
      "name" : "alice"
    },
    "request" : {
      "headers" : {
        "Accept" : [ "application/json" ]
      },
      "method" : "GET",
      "uri" : "https://api.example.com"
    },
    "response" : {
      "headers" : {
        "Content-Type" : [ "application/json" ]
      },
      "status" : 200
    },
    "session" : {
      "id" : "fd32f567-6552-4737-905f-778dbe6bff70"
    },
    "timeTaken" : "PT0.023S",
    "timestamp" : "2022-12-22T13:43:41Z"
  } ]
}响应结构
响应包含跟踪的 HTTP 请求-响应交换的详细信息。 下表描述了响应的结构:
| 路径 | 类型 | 描述 | 
|---|---|---|
| 
 | 
 | HTTP 请求-响应交换的数组。 | 
| 
 | 
 | 交换发生的时间戳。 | 
| 
 | 
 | 交易所的负责人(如有)。 | 
| 
 | 
 | 主体的名称。 | 
| 
 | 
 | HTTP 方法。 | 
| 
 | 
 | 接收请求的远程地址(如果已知)。 | 
| 
 | 
 | 请求的 URI。 | 
| 
 | 
 | 请求的标头,以标头名称为键。 | 
| 
 | 
 | 标头的值 | 
| 
 | 
 | 响应状态 | 
| 
 | 
 | 响应的标头,以标头名称为键。 | 
| 
 | 
 | 标头的值 | 
| 
 | 
 | 与交换关联的会话(如果有)。 | 
| 
 | 
 | 会话的 ID。 | 
| 
 | 
 | 处理交换所需的时间。 |