Response time in REST client
已回答
The Intellij REST client gives me an answer like
Response code: 200 (200); Time: 2021ms (2 s 21 ms); Content length: 771481 bytes (771,48 kB)Can I access the time programatically in client.test()?
I know, that I can measure the time myself, but the client has already measured it.
请先登录再写评论。
I'm afraid not. The displayed
Time: ...value is currently UI/runner metadata rather than a script-accessible property.The IntelliJ HTTP Client currently does not expose the UI-measured request duration through
responseorclient.test(). The documented response object provides response data such as status, headers, body, and content type, whileclient.test()only registers assertions.You will need to measure it yourself. Placing the timestamp in a pre-request script will allow you to include the network request duration: