HTTP 交換 (httpexchanges)
httpexchanges 端點提供有關 HTTP 請求-響應交換的資訊。
檢索 HTTP 交換
要檢索 HTTP 交換,請向 /actuator/httpexchanges 發出 GET 請求,如以下基於 curl 的示例所示
$ curl 'https://:8080/actuator/httpexchanges' -i -X GET
結果響應類似於以下內容
HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 511
{
"exchanges" : [ {
"timestamp" : "2022-12-22T13:43:41Z",
"request" : {
"headers" : {
"Accept" : [ "application/json" ]
},
"method" : "GET",
"uri" : "https://api.example.com"
},
"response" : {
"headers" : {
"Content-Type" : [ "application/json" ]
},
"status" : 200
},
"principal" : {
"name" : "alice"
},
"session" : {
"id" : "7baf7dde-eb28-4571-8579-d787a7413e25"
},
"timeTaken" : "PT0.023S"
} ]
}
響應結構
響應包含跟蹤的 HTTP 請求-響應交換的詳細資訊。下表描述了響應的結構
| 路徑 | 型別 | 描述 |
|---|---|---|
|
|
HTTP 請求-響應交換的陣列。 |
|
|
交換髮生的時間戳。 |
|
|
交換的主體(如果存在)。 |
|
|
主體的名稱。 |
|
|
請求的 HTTP 方法。 |
|
|
接收請求的遠端地址(如果已知)。 |
|
|
請求的 URI。 |
|
|
請求的頭部,以頭部名稱為鍵。 |
|
|
頭部的值 |
|
|
響應的狀態 |
|
|
響應的頭部,以頭部名稱為鍵。 |
|
|
頭部的值 |
|
|
與交換關聯的會話(如果存在)。 |
|
|
會話的 ID。 |
|
|
處理交換所花費的時間。 |